软件教程

ASP中FormatDateTime函数用法详解

来源: 本站    类别: 软件教程    日期: 2012/6/1

 

FormatDateTime 函数

返回表达式,此表达式已被格式化为日期或时间。

FormatDateTime(Date[, NamedFormat])

参数

参数

描述

date

Required. Any valid date expression (like Date() or Now())

必选项。要被格式化的日期表达式。(如Date()或Now())

format

Optional. A Format value that specifies the date/time format to use

可选项。指示所使用的日期/时间格式的数值

设置

NamedFormat 参数可以有以下值:

常数

描述

vbGeneralDate

0

Display a date in format mm/dd/yy. If the date parameter is Now(), it will also return the time, after the date

显示日期和/或时间。如果有日期部分,则将该部分显示为短日期格式。如果有时间部分,则将该部分显示为长时间格式。如果都存在,则显示所有部分。

vbLongDate

1

Display a date using the long date format: weekday, month day, year

使用计算机区域设置中指定的长日期格式显示日期

vbShortDate

2

Display a date using the short date format: like the default (mm/dd/yy)

使用计算机区域设置中指定的短日期格式显示日期。如默认的(月/日/年)

vbLongTime

3

Display a time using the time format: hh:mm:ss PM/AM

使用计算机区域设置中指定的时间格式显示时间

vbShortTime

4

Display a time using the 24-hour format: hh:mm

使用 24 小时格式 (hh:mm) 显示时间


相关文章


Copyright © 2004 - 2025 CNHWW Inc. All Rights Reserved
石家庄市征红网络科技有限公司版权所有 邮政编码:050051
服务电话:0311-85315152 13931185013 在线客服QQ:81447932 / 81447933 邮箱: cnhww@163.com