在ASP中用FormatDateTime格式化日期
时间:2010-08-08 19:16:00
描述
返回表达式,此表达式已被格式化为日期或时间。
语法FormatDateTime(Date[, NamedFormat])
FormatDateTime 函数的语法有以下参数:
参数 描述
Date 必选。要被格式化的日期表达式。
NamedFormat 可选。指示所使用的日期/时间格式的数值,如果省略,则使用 vbGeneralDate。
设置
NamedFormat 参数可以有以下值:
常数 值 描述
vbGeneralDate 0 显示日期和/或时间。如果有日期部分,则将该部分显示为短日期格式。如果有时间部分,则将该部分显示为长时间格式。如果都存在,则显示所有部分。
vbLongDate 1 使用计算机区域设置中指定的长日期格式显示日期。
vbShortDate 2 使用计算机区域设置中指定的短日期格式显示日期。
vbLongTime 3 使用计算机区域设置中指定的时间格式显示时间。
vbShortTime 4 使用 24 小时格式 (hh:mm) 显示时间。
说明
下面例子利用 FormatDateTime 函数把表达式格式化为长日期型并且把它赋给 MyDateTime:
Function GetCurrentDate
'FormatDateTime 把日期型格式化为长日期型。
GetCurrentDate = FormatDateTime(Date, 1)
End Function
标签:FormatDateTime,格式化,日期
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
ASP和Javascript中取整函数的应用
2009-06-07 18:38:00
什么是Dynamic HTML(Dhtml)
2010-03-16 12:40:00
mysql中普通索引和唯一索引的效率对比
2010-12-08 16:03:00
![](https://img.aspxhome.com/file/UploadPic/201012/8/2010128165343945s.jpg)
在asp中使用js的encodeURIComponent方法
2012-11-30 20:05:53
学习ASP.NET八天入门:第五天
2007-08-07 13:43:00
我的ImageMagick使用心得
2008-10-21 11:05:00
![](https://img.aspxhome.com/file/UploadPic/200810/21/20081021122020655s.jpg)
asp封装dll源码分享
2008-09-25 17:20:00
![](https://img.aspxhome.com/file/UploadPic/20089/25/asp-dll_50s.jpg)
如何使用SQLServer数据库查询累计值
2009-03-16 14:43:00
新 API 寻求让 JavaScript 操作本地文件
2009-11-27 18:28:00
![](https://img.aspxhome.com/file/UploadPic/200911/27/2g33954gi_lit-43s.gif)
13个超级有用的 jQuery 内容滚动插件和教程
2011-08-10 19:10:08
![](https://img.aspxhome.com/file/UploadPic/20118/10/1312421955631-33s.jpg)
五种方法解决 Web2.0设计中的匹配度
2007-09-22 10:58:00
提醒各位一下,IE透明会失效的
2009-03-31 12:48:00
![](https://img.aspxhome.com/file/UploadPic/20093/31/icon_lol-37s.gif)
用css3-tranistions实现平滑过渡
2009-12-23 19:24:00
FF和IE之间7个JavaScript的差异[译]
2009-05-04 18:19:00
CSS阴影详解
2009-12-04 18:31:00
![](https://img.aspxhome.com/file/UploadPic/200912/4/textshadow1-78s.jpg)
Javascript学习第一季 三
2008-06-27 13:08:00
CGArt®2008 贺岁刊电子杂志玉鼠闹春
2008-02-15 08:59:00
![](https://img.aspxhome.com/file/UploadPic/20082/15/200821511345421s.jpg)
仿豆瓣分页原型(Javascript版)
2007-11-05 14:04:00
Asp中Server.ScriptTimeOut脚本超时属性需要注意的一点
2008-10-18 14:53:00
为你的有序列表添加个性样式
2009-02-23 13:12:00
![](https://img.aspxhome.com/file/UploadPic/20092/23/ol-overview-60s.gif)