ASP常用函数收藏乱七八糟未整理版(33)
' www.adopenstatic.com/resources/code/formatdate.asp
' Template items
' %m Month as a decimal no. 2
' %M Month as a padded decimal no. 02
' %B Full month name February
' %b Abbreviated month name Feb
' %d Day of the month eg 23
' %D Padded day of the month eg 09
' %O ordinal of day of month (eg st or rd or nd)
' %j Day of the year 54
' %Y Year with century 1998
' %y Year without century 98
' %w Weekday as integer (0 is Sunday)
' %a Abbreviated day name Fri
' %A Weekday Name Friday
' %H Hour in 24 hour format 24
' %h Hour in 12 hour format 12
' %N Minute as an integer 01
' %n Minute as optional if minute <> 00
' %S Second as an integer 55
' %P AM/PM Indicator PM
On Error Resume Next
Dim intPosItem
Dim int12HourPart
Dim str24HourPart
Dim strMinutePart
Dim strSecondPart
Dim strAMPM
' Insert Month Numbers
strFormat = Replace(strFormat, "%m", DatePart("m", strDate), 1, -1, vbBinaryCompare)
' Insert Padded Month Numbers
strFormat = Replace(strFormat, "%M", Right("0" & DatePart("m", strDate), 2), 1, -1, vbBinaryCompare)
' Insert non-Abbreviated Month Names
strFormat = Replace(strFormat, "%B", MonthName(DatePart("m", strDate), False), 1, -1, vbBinaryCompare)
' Insert Abbreviated Month Names
内容版权声明:除非注明,否则皆为本站原创文章。