展会信息港展会大全

asp 格式化时间日期 android软件开发教程
来源:互联网   发布日期:2016-03-01 13:07:26   浏览:1641次  

导读:asp教程 格式化时间日期 public function formatdt(dt, style) 'style=0 2000-10-10 下午 12:17:45 'style=1 2000-10-10 23:17:45 'style=2 2000-10-10 23:45 'style=3 00-10-10 23:45 'style=4 10-10 23:45 'style=5 2000-10-10 'style=6 00-10-10 'style=7...

asp教程 格式化时间日期

public function formatdt(dt, style)

'style=0 2000-10-10 下午 12:17:45

'style=1 2000-10-10 23:17:45

'style=2 2000-10-10 23:45

'style=3 00-10-10 23:45

'style=4 10-10 23:45

'style=5 2000-10-10

'style=6 00-10-10

'style=7 10-10

'style=8 23h-45m-45s

'style=9 20001010231745

'style=10 0510上传图片

'style=11 05年10月10日

'style=12 05/10/12上传图片

dim nowdate, y, m, d, h, i, s, t, apm, hapm

nowdate = dt

y = year(nowdate)

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

m = month(nowdate)

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

d = day(nowdate)

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

h = hour(nowdate)

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

i = minute(nowdate)

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

s = second(nowdate)

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

if h > 12 then

apm = "下午 "

hapm = cstr(cint(h) mod 12)

else

apm = "上午 "

hapm = h

end if

select case style

case 0

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

case 1

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

case 2

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

case 3

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

case 4

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

case 5

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

case 6

t = right(y, 2) & "-" & m & "-" & d

case 7

t = m & "-" & d

case 8

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

case 9

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

case 10'上传

t = right(y, 2) & m

case 11

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

case 12

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

end select

formatdt = t

end function

赞助本站

人工智能实验室

相关热词: 开发 编程 android

AiLab云推荐
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港