登录123 | 账号: 密码: 今天是: 加入收藏 返回首页 

同城供应求购,商机就在身边 免费企业商铺,免费发布商机 关注商业资讯,把握商业机会 同城库存二手,晒出您的宝贝,淘进新的宝贝
全国企业黄页大全,加入即可得到推广
返回同城123首页
同城123信息网,最全最专业的同城分类信息网
同城生活贴吧,贴出生活的精彩 同城房屋租售,卖房、买房、租房、出租 同城招聘求职,优秀人才/高薪岗位等您来 同城婚恋交友,寻找你的TA
免费无极限,广告任意发
供应求购 免费商铺 商业资讯 库存二手 黄页大全 生活贴吧 房屋租售 招聘求职 婚恋交友 自助广告

ASP中CDate函数的用法
发布时间:2010-11-13 15:07:07 发布人:网络游民 点击:657
The CDate function converts a valid date and time expression to type Date, and returns the result.
CDate函数能够将有效的日期或是时间表达式转换成为Date类型并返回结果。

Tip: Use the IsDate function to determine if date can be converted to a date or time.
提示:可以使用IsDate函数来判断能否转换成为日期或是时间。

Note: The IsDate function uses local setting to determine if a string can be converted to a date ("January" is not a month in all languages.)
注意:IsDate函数使用的是本地化设置来判断字符串是否能够转换成为日期("January"在所有语言中不一定代表为一个月份)

Syntax
语法
CDate(date)

Parameter
参数 Description
描述
date Required. Any valid date expression (like Date() or Now())
必须的。任何有效的日期表达式(如 Date()或Now())

Example 1
举例 1
d="April 22, 2001"if IsDate(d) then document.write(CDate(d))end ifOutput:2/22/01

Example 2
举例 2
d=#2/22/01#if IsDate(d) then document.write(CDate(d))end ifOutput:2/22/01

Example 3
举例 3
d="3:18:40 AM"if IsDate(d) then document.write(CDate(d))end ifOutput:3:18:40 AM


--------------------------------------------------------------------------------

Try-It-Yourself Demos
演示
Convert a string to a date object
How to use CDate to convert a string to a date.
使用CDate将字符串转换为日期

Convert numbers to a date object
How to use CDate to convert a numbers with separators to a date.
使用CDate将分隔的数字转换成为日期

Convert a string to a time object
How to use CDate to convert a numbers a time object.
使用CDate将数字转换成时间对象

回复此帖
123发布网广告位【218】 123发布网广告位【219】
 ※ 发布回复   ↓请遵循123发布网同城生活贴吧/论坛发帖规则;↓寻一夜情、包养、招嫖类信息的一律全部删除,并报公安备案↓  
回复标题:  
回复内容:
上传图片:
验 证 码:  

123发布网广告位【220】 123发布网广告位【221】
网站首页 | 关于我们 | 广告业务 | 关于VIP | 免责声明 | 联系我们 | 设为首页 | 加入收藏 | 意见反馈 | 网站建设
123发布网 版权所有 www.123fbw.com  联系电话:18331151646  QQ:1016964448
 CopyRight © 2007-2016 All Right Reserved  联系站长  津ICP备10002728号  统计: