复制代码 代码如下:
<%
function timetosecond(str)
'时间转为秒函数
str = datediff("s","1970-01-01 08:00:00",str)
timetosecond = str
end function
function secondtotime(str)
'秒转为时间函数
str = dateadd("s",str,"1970-01-01 08:00:00")
secondtotime = str
end function
'简单的使用例子
response.write "时间转换为秒:"&timetosecond(now())&"<br>"response.write "秒转换为时间:"&secondtotime("1164074979")
%>
ok,有了以上的时间转换函数,我们就可以完成这样的查找功能了。例如:查找在几小时或者是几天内发表的最新文章了。
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!