风易博客

风萧萧兮易水寒, 壮士一去兮不复还。

« 十万火急提醒你五件事!虚拟主机1MB一块,代安装博客,论坛,CMS系统 »

转换时间为GMT格式的函数

会说话的博客,点我试试:)
我们在做RSS输出时,通常需要把时间转换成GMT格式,很遗憾,ASP中并没有提供这样的函数,那么就需要我们自定义一个函数了.
代码如下:

'转换时间为GMT格式
Function DateTimeToGMT(sDate)
Dim dWeek,dMonth
Dim strZero,strZone
strZero="00"
strZone="+0800"
dWeek=Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat")
dMonth=Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
DateTimeToGMT = dWeek(WeekDay(sDate)-1)&", "&Right(strZero&Day(sDate),2)&" "&dMonth(Month(sDate)-1)&" "&Year(sDate)&" "&Right(strZero&Hour(sDate),2)&":"&Right(strZero&Minute(sDate),2)&":"&Right(strZero&Second(sDate),2)&" "&strZone
End Function


调用实例: DateTimeToGMT(Now())
  • 相关文章:

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

日历

最新评论及回复

最近发表

Powered By Z-Blog 1.8 Spirit Build 80722 Code detection by Codefense  theme by BokeZhuti

Copyright © 2005 - 2008 风易博客 1982Y.Net.Cn All Rights Reserved.  由Wind88.Net提供优质主机空间
沪ICP备05006417号