html显示英文月份,asp 日期“月”英文显示。例如3月 mar

asp 日期“月”英文显示。例如3月 mar0

FunctionFormatDate(DateAndTime,Format)OnErrorResumeNextDimyy,y,m,d,h,mi,s,strDateTimeFormatDate=DateAndTimeIfNotIsNumeric(Format)ThenExitFunctionIfNotIsDate(DateAndTime)T... Function FormatDate(DateAndTime, Format)

On Error Resume Next

Dim yy,y, m, d, h, mi, s, strDateTime

FormatDate = DateAndTime

If Not IsNumeric(Format) Then Exit Function

If Not IsDate(DateAndTime) Then Exit Function

yy = CStr(Year(DateAndTime))

y = Mid(CStr(Year(DateAndTime)),3)

m = CStr(Month(DateAndTime))

If Len(m) = 1 Then m = "0" & m

d = CStr(Day(DateAndTime))

If Len(d) = 1 Then d = "0" & d

h = CStr(Hour(DateAndTime))

If Len(h) = 1 Then h = "0" & h

mi = CStr(Minute(DateAndTime))

If Len(mi) = 1 Then mi = "0" & mi

s = CStr(Second(DateAndTime))

If Len(s) = 1 Then s = "0" & s

Select Case Format

Case "1"

strDateTime = y & "-" & m & "-" & d & " " & h & ":" & mi & ":" & s

Case "2"

strDateTime = yy & m & d & h & mi & s

Case "3"

strDateTime = yy & m & d & h & mi

Case "4"

strDateTime = m

Case "5"

strDateTime = m & "-" & d

Case "6"

strDateTime = m & "/" & d

Case "7"

strDateTime = m & "月" & d & "日"

Case "8"

strDateTime = y & "年" & m & "月"

Case "9"

strDateTime = y & "-" & m

Case "10"

strDateTime = y & "/" & m

Case "11"

strDateTime = y & "-" & m & "-" & d

Case "12"

strDateTime = y & "/" & m & "/" & d

Case "13"

strDateTime = yy & "." & m & "." & d

Case "14"

strDateTime = yy & "-" & m & "-" & d

Case Else

strDateTime = DateAndTime

End Select

FormatDate = strDateTime

End Function 展开

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值