云霄假烟通缉犯照片:asp返回时间的小时

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/29 18:07:00
如何实现返回时间的小时部分
并且是24小时制的

<%=Hour(Now)%>

function time_type(tvar,tt)
dim ttt,d_year,d_month,d_day,d_hour,d_minute,d_second
ttt=tvar
if ttt="" or isnull(ttt) then ttt=now
if not(isdate(ttt)) then
time_type=""
exit function
end if
d_year=year(ttt)
d_month=month(ttt)
if len(d_month)<2 then d_month="0"&d_month
d_day=day(ttt)
if len(d_day)<2 then d_day="0"&d_day
d_hour=hour(ttt)
if len(d_hour)<2 then d_hour="0"&d_hour
d_minute=minute(ttt)
if len(d_minute)<2 then d_minute="0"&d_minute
d_second=second(ttt)
if len(d_second)<2 then d_second="0"&d_second
select case tt
case 1 '2000-10-10 23:45:45
time_type=d_year&"-"&d_month&"-"&d_day&" "&d_hour&":"&d_minute&":"&d_second
case 2 '年(4)-月-日 时:分:秒
time_type=d_year&"年"&d_month&"月"&d_day&"日 "&d_hour&"时"&d_minute&"分"&d_second&"秒"
case 3 '10-10
time_type=d_month&"-"&d_day
case 4 '2003-10-10
time_type=d_year&"-"&d_month&"-"&d_day
case 5 '2003年10月10日
time_type=d_year&"年"&d_month&"月"&d_day&"日"
case else
time_type=ttt
end select
end function
应用response.write time_type(rs("time"),4)

<%= left(time(),2) %>
是什么时间制,就要看你电脑的设置了。