您正在使用 IPV4 [3.81.97.37] 访问本站,您本次已经查看了 1 页
用户名: 密 码: 验证码:     用QQ登录本站
首页 软件 编程 笑话 知识 公告 台风 日历 计算器
[公益]保护绿色环境,构建和谐社会       悟空收录网      

【腾讯云】 爆款2核2G3M云服务器首年 61元,叠加红包再享折上折      
[公益] 地球是我家,绿化靠大家      
2024年 清明节 007
2024年 劳动节 034
2025年 元 旦 279
2025年 春 节 307
 
您现在的位置:首页 >> ASP/ASP.net >> 内容
本类新增
本类热门
ASP格式化时间函数
内容摘要: 'ASP格式化时间函数functionformatdate(dateandtime,para)onerrorresumenextdimy,m,d,h,mi,s,strdatetimeformatdate=dateandtimeifnotisnumeric(para)thenexitfunctionifnotisdate(dateandtime)thenexi......
'ASP格式化时间函数

functionformatdate(dateandtime,para)

onerrorresumenext

dimy,m,d,h,mi,s,strdatetime

formatdate=dateandtime

ifnotisnumeric(para)thenexitfunction

ifnotisdate(dateandtime)thenexitfunction

y=cstr(year(dateandtime))

m=cstr(month(dateandtime))

iflen(m)=1thenm="0"&m

d=cstr(day(dateandtime))

iflen(d)=1thend="0"&d

h=cstr(hour(dateandtime))

iflen(h)=1thenh="0"&h

mi=cstr(minute(dateandtime))

iflen(mi)=1thenmi="0"&mi

s=cstr(second(dateandtime))

iflen(s)=1thens="0"&s

selectcasepara

case"1"

strdatetime=y&"-"&m&"-"&d&""&h&":"&mi&":"&s

case"2"

strdatetime=y&"-"&m&"-"&d

case"3"

strdatetime=y&"/"&m&"/"&d

case"4"

strdatetime=y&"年"&m&"月"&d&"日"&h&":"&mi&":"&s

case"5"

strdatetime=m&"-"&d&""&h&":"&mi

case"6"

strdatetime=m&"/"&d

case"7"

strdatetime=m&"月"&d&"日"

case"8"

strdatetime=y&"年"&m&"月"

case"9"

strdatetime=y&"-"&m

case"10"

strdatetime=y&"/"&m

case"11"

strdatetime=right(y,2)&"-"&m&"-"&d&""&h&":"&mi

case"12"

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

case"13"

strdatetime=m&"-"&d

caseelse

strdatetime=dateandtime

endselect

formatdate=strdatetime

endfunction

版权声明:本内容来源于网络,如有侵犯您的版权,请联系站长,本站收到您的信息后将及时处理。
上一篇:ASP.NET汉字转拼音首字母的代码类

 

下一篇:asp获取当前域名和端口号方法

发布日期:2021/8/25
手机扫二维码直达本页
发布时间:9:52:51
点  击:4
录  入:齐天大圣
相关文章
Baidu
YiJiaCMS 7.3.8 build231228(MSSQL) 闽ICP备05000814号-1
本空间由腾讯云(轻量应用服务器)提供,Cloudflare提供加速防护
运行时间载入中.....