asp教程 格式化時間日期
public function formatdt(dt
dim nowdate
nowdate = dt
y = year(nowdate)
if len(y)=
m = month(nowdate)
if len(m)=
d = day(nowdate)
if len(d)=
h = hour(nowdate)
if len(h)=
i = minute(nowdate)
if len(i)=
s = second(nowdate)
if len(s)=
if h >
apm = "下午 "
hapm = cstr(cint(h) mod
else
apm = "上午 "
hapm = h
end if
select case style
case
t = y & "
case
t = y & "
case
t = y & "
case
t = right(y
case
t = m & "
case
t = y & "
case
t = right(y
case
t = m & "
case
t = h & "h
case
t = y & m & d & h & i & s
case
t = right(y
case
t = right(y
case
t = right(y
end select
formatdt = t
end function
From:http://tw.wingwit.com/Article/program/net/201311/14417.html