asp

位置:IT落伍者 >> asp >> 浏览文章

asp 格式化时间日期


发布日期:2019年05月10日
 
asp 格式化时间日期

asp教程 格式化时间日期

public function formatdt(dt style)

style= 下午 ::

style= ::

style= :

style= :

style= :

style=

style=

style=

style= hms

style=

style= 上传图片

style=

style= //上传图片

dim nowdate y m d h i s t apm hapm

nowdate = dt

y = year(nowdate)

if len(y)= then y=""&y

m = month(nowdate)

if len(m)= then m=""&m

d = day(nowdate)

if len(d)= then d=""&d

h = hour(nowdate)

if len(h)= then h=""&h

i = minute(nowdate)

if len(i)= then i=""&i

s = second(nowdate)

if len(s)= then s=""&s

if h > then

apm = "下午 "

hapm = cstr(cint(h) mod )

else

apm = "上午 "

hapm = h

end if

select case style

case

t = y & "" & m & "" & d & " " & apm & hapm & ":" & i & ":" & s

case

t = y & "" & m & "" & d & " " & h & ":" & i & ":" & s

case

t = y & "" & m & "" & d & " " & h & ":" & i

case

t = right(y ) & "" & m & "" & d & " " & h & ":" & i

case

t = m & "" & d & " " & h & ":" & i

case

t = y & "" & m & "" & d

case

t = right(y ) & "" & m & "" & d

case

t = m & "" & d

case

t = h & "h" & i & "m" & s &"s"

case

t = y & m & d & h & i & s

case 上传

t = right(y ) & m

case

t = right(y ) & "年" & m & "月" & d & "日"

case

t = right(y ) & "/" & m & "/" & d

end select

formatdt = t

end function

上一篇:学习asp的八个重点

下一篇:asp For Next 循环语句语法与实例