有很多种方式来显示日期,时间和在两个日期之间的区别。这个下面的代码对显示今天和1776年7月4日的区别有很多方式。
date() = <%= date() %>
<br>
now() = <%= now() %>
<br>
time() = <%= time() %>
<br>
month(date()) = <%= month(date()) %>
<br>
day(date()) = <%= day(date()) %>
<br>
year(date()) = <%= year(date()) %>
<br>
hour(now()) = <%= hour(now()) %>
<br>
minute(now()) = <%= minute(now()) %>
<br>
second(now()) = <%= second(now()) %>
<br>
weekday(now()) = <%= weekday(now()) %>
<br>
formatdatetime(now(),vbgeneraldate) = <%= formatdatetime(now(),vbgeneraldate) %>
<br>
formatdatetime(now(),vblongdate) = <%= formatdatetime(now(),vblongdate) %>
<br>
formatdatetime(now(),vbshortdate) = <%= formatdatetime(now(),vbshortdate) %>
<br>
formatdatetime(now(),vblongtime) = <%= formatdatetime(now(),vblongtime) %>
<br>
formatdatetime(now(),vbshorttime) = <%= formatdatetime(now(),vbshorttime) %>
<br>
year(s) from dates <br>
date_variable = #7/4/1776# <br>
<% date_variable = #7/4/1776# %>
datediff("yyyy",date_variable,date()) =
<%=datediff("yyyy",date_variable,date()) %>
<br>
day(s) from dates <br>
date_variable = #7/4/1776# <br>
<% date_variable = #7/4/1776# %>
datediff(date() - date_variable) =
<%= (date() - date_variable) %>
date() = <%= date() %>
<br>
now() = <%= now() %>
<br>
time() = <%= time() %>
<br>
month(date()) = <%= month(date()) %>
<br>
day(date()) = <%= day(date()) %>
<br>
year(date()) = <%= year(date()) %>
<br>
hour(now()) = <%= hour(now()) %>
<br>
minute(now()) = <%= minute(now()) %>
<br>
second(now()) = <%= second(now()) %>
<br>
weekday(now()) = <%= weekday(now()) %>
<br>
formatdatetime(now(),vbgeneraldate) = <%= formatdatetime(now(),vbgeneraldate) %>
<br>
formatdatetime(now(),vblongdate) = <%= formatdatetime(now(),vblongdate) %>
<br>
formatdatetime(now(),vbshortdate) = <%= formatdatetime(now(),vbshortdate) %>
<br>
formatdatetime(now(),vblongtime) = <%= formatdatetime(now(),vblongtime) %>
<br>
formatdatetime(now(),vbshorttime) = <%= formatdatetime(now(),vbshorttime) %>
<br>
year(s) from dates <br>
date_variable = #7/4/1776# <br>
<% date_variable = #7/4/1776# %>
datediff("yyyy",date_variable,date()) =
<%=datediff("yyyy",date_variable,date()) %>
<br>
day(s) from dates <br>
date_variable = #7/4/1776# <br>
<% date_variable = #7/4/1776# %>
datediff(date() - date_variable) =
<%= (date() - date_variable) %>
<br>
简单生活,希望对大家有用!要觉得本文有价值请分享给您的朋友,生活就是人来人往,分享越多!收获越多!作者:天天ASP家园