DateDiff()
FUNCTION: 返回两个日期之间的差值 。
SYNTAX: DateDiff(timeinterval,date1,date2 [, firstdayofweek [, firstweekofyear[/IMG][/IMG])
ARGUMENTS: timeinterval 表示相隔时间的类型,如“M“表示“月”。
EXAMPLE: <%
fromDate = #8/4/99#
toDate = #1/1/2000#
response.write "There are " & _
DateDiff("d",fromDate,toDate) & _
" days to millenium from 8/4/99."
%[/IMG]
RESULT: 从8/4/99 到2000年还有 150 天.
FUNCTION: 返回两个日期之间的差值 。
SYNTAX: DateDiff(timeinterval,date1,date2 [, firstdayofweek [, firstweekofyear[/IMG][/IMG])
ARGUMENTS: timeinterval 表示相隔时间的类型,如“M“表示“月”。
EXAMPLE: <%
fromDate = #8/4/99#
toDate = #1/1/2000#
response.write "There are " & _
DateDiff("d",fromDate,toDate) & _
" days to millenium from 8/4/99."
%[/IMG]
RESULT: 从8/4/99 到2000年还有 150 天.
function fun1()
{
var st = new Date(2004,12,23,13,53,10); //发贴时间,可以自己格式化一下
var nt = new Date(); //当前时间
var tmp = Math.ceil(((nt-st)/1000/60/60/24)+28); alert('发贴时间:'+st+'\n当前时间:'+nt+'\n差值:'+tmp+'天'); if(tmp>60)
{
alert('It is locked!!');
}
else
{
alert('It is Ok!');
}
}
</SCRIPT>