西安网站建设ASP显示中文星期

12762015-03-26

西安网站建设ASP显示中文星期

Function FormatWeekday(strdate)

select case strdate

 case 1:FormatWeekday = "日"

 case 2:FormatWeekday = "一"

 case 3:FormatWeekday = "二"

 case 4:FormatWeekday = "三"

 case 5:FormatWeekday = "四"

 case 6:FormatWeekday = "五"

 case 7:FormatWeekday = "六"

end select

End Function

西安网站建设ASP把时间日期格式化为英文格式

Public Function FormatDate_en(DateAndTime)

On Error Resume Next

Dim y, m, d, h, mi, s, strDateTime,months,weeks,w

FormatDate_en = DateAndTime

If Not IsDate(DateAndTime) Then Exit Function

y = CStr(Year(DateAndTime))

m = CStr(Month(DateAndTime))

d = CStr(Day(DateAndTime))

w=Weekday(DateAndTime)

select case m

case "1"

months="January"

case "2"

months="February"

case "3"

months="March"

case "4"

months="April"

case "5"

months="May"

case "6"

months="June"

case "7"

months="July"

case "8"

months="August"

case "9"

months="September"

case "10"

months="October"

case "11"

months="November"

case else

months="December"

end select

select case w

case "2"

weeks="Monday"

case "3"

weeks="Tuesday"

case "4"

weeks="Wednesday"

case "5"

weeks="Thursday"

case "6"

weeks="Friday"

case "7"

weeks="Saturday"

case else

weeks="Sunday"

end select

strDateTime = weeks &", " &months&", "& d &", "& y

FormatDate_en = strDateTime

End Function

西安网站建设ASP把日期格式化为常见格式

'================================================

'函数名:FormatDate

'作 用:格式化日期

'参 数:DateAndTime ----原日期和时间

' para ----日期格式

'返回值:格式化后的日期

'================================================

Public Function FormatDate(DateAndTime, para)

On Error Resume Next

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

FormatDate = DateAndTime

If Not IsNumeric(para) Then Exit Function

If Not IsDate(DateAndTime) Then Exit Function

y = CStr(Year(DateAndTime))

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 para

Case "1"

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

Case "2"

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

Case "3"

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

Case "4"

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

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 Else

strDateTime = DateAndTime

End Select

FormatDate = strDateTime

通过本文您对西安网站建设有了进一步了解,本公司温馨提醒:找西安做网站公司,请选择手续齐全、业务精、服务好的正规公司。

工商网上亮照

版权所有:西安点墨网络科技有限公司 信息备案编号: 陕ICP备11004160号-1

客户服务电话:15229292610

公司注册地址:西安市雁塔区融鑫路丽湾蓝岛1幢3单元16层31605号

临时办公地址:西安市雁塔区朱雀大街紫郡长安F3

Sitemap 网站地图 手机版

服务热线:15229292610

客服信箱:vip@dianmo.cc

846461336327

版权所有:西安点墨网络科技有限公司 信息备案编号: 陕ICP备11004160号-1