Function ftime(fttime)
yyyy = year(fttime)
mm = month(fttime)
if len(mm) = 1 then
mm = “0″ & mm
end if
dd = day(fttime)
if len(dd) = 1 then
dd = “0″ & dd
end if
hh = hour(fttime)
if len(hh) = 1 then
hh = “0″ & hh
end if
mo = Minute(fttime)
if len(mo) = 1 then
mo = “0″ & mo
end if
se = Second(fttime)
if len(se) = 1 then
se = “0″ & se
end if
ftime = yyyy & “-” & mm & “-” & dd & “T” & hh & “:” & mo & “:” & se & “+08:00″
end Function
google sitemap中关于时间lastmod的处理
在asp中好像没有直接得到格林威治时间的函数(我没看到),而在google的sitemap采用的ISO 8601时间格式,需要转换一下
只好手工写一个函数,感觉这样效率差,要是直接有函数转换就好了
yyyy = year(fttime)
mm = month(fttime)
if len(mm) = 1 then
mm = “0″ & mm
end if
dd = day(fttime)
if len(dd) = 1 then
dd = “0″ & dd
end if
hh = hour(fttime)
if len(hh) = 1 then
hh = “0″ & hh
end if
mo = Minute(fttime)
if len(mo) = 1 then
mo = “0″ & mo
end if
se = Second(fttime)
if len(se) = 1 then
se = “0″ & se
end if
ftime = yyyy & “-” & mm & “-” & dd & “T” & hh & “:” & mo & “:” & se & “+08:00″
end Function
原文地址:http://ai-2.cn/2008/09/google_sitemap_lastmod/
转载请注明出处,非常感谢!