ASP中日期应用

ASP中日期应用
1、取当前时间 Response.write Now&Chr(13) 结果输出:2006-12-7 11:59:31
2、DateAdd的用法 Response.write DateAdd("d",1,date)&Chr(13) 结果输出:2006-12-8
说明:
yyyy 年
q 季度
m 月
y 一年的日数
d 日
w 一周的日数
ww 周 h 小时
n 分钟
s 秒
3、format日期 Response.write FormatDateTime(now,2)&Chr(13) 结果输出:2006-12-8
说明:
vbGeneralDate 0
显示日期和/或时间。如果有日期部分,则将该部分显示为短日期格式。如果有时间部分,则将该部分显示为长时间格式。如果都存在,则显示所有部分。
vbLongDate 1 使用计算机区域设置中指定的长日期格式显示日期。
vbShortDate 2 使用计算机区域设置中指定的短日期格式显示日期。
vbLongTime 3 使用计算机区域设置中指定的时间格式显示时间。
vbShortTime 4 使用 24 小时格式 (hh:mm) 显示时间。

你可能感兴趣的:(ASP中日期应用)