ASP 格式化时间函数
发布时间:2020-12-17 07:59:57 所属栏目:百科 来源:网络整理
导读:今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 '格式化时间函数public function formatdate(dateandtime,para)on error resume nextdim y,m,d,h,mi,s,strdatetimeformatdate = dateandtimeif not is
以下代码由PHP站长网 52php.cn收集自互联网 现在PHP站长网小编把它分享给大家,仅供参考 '格式化时间函数 public function formatdate(dateandtime,para) on error resume next dim y,m,d,h,mi,s,strdatetime formatdate = dateandtime if not isnumeric(para) then exit function if not isdate(dateandtime) then exit function y = cstr(year(dateandtime)) m = cstr(month(dateandtime)) if len(m) = 1 then m = "0" & m d = cstr(day(dateandtime)) if len(d) = 1 then d = "0" & d h = cstr(hour(dateandtime)) if len(h) = 1 then h = "0" & h mi = cstr(minute(dateandtime)) if len(mi) = 1 then mi = "0" & mi s = cstr(second(dateandtime)) if len(s) = 1 then s = "0" & s select case para 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 case else strdatetime = dateandtime end select formatdate = strdatetime end function 以上内容由PHP站长网【52php.cn】收集整理供大家参考研究 如果以上内容对您有帮助,欢迎收藏、点赞、推荐、分享。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- Jsoncpp未知Json获取所有Key和Value
- 华为交换机配置命令大全
- Unexpected exception parsing XML document from class pa
- vue项目打包后打开页面空白解决办法
- “<>”在SQLDeveloper中是什么意思?
- ble学习笔记十五----------ble协议栈之flash数据存储实验
- c# – LINQ to Entities不能识别方法’System.String get_I
- AS3垃圾回收站机制
- 通过Applescript将文件添加到Xcode项目目标
- SQLite3 for WinCE or Mobile (EVC篇) (转载)