所属类别:Asp
文章作者:佚名
特别推荐:免费发布信息 承包关键词~~抢爆了!HOT!
<%'----日期转化函数-----function wf_DateToChar(datetime,l)'---------说明------------'datetime是你要转化的日期值'l是你要转化到的层次,可设为"d"、"n"和"s"'"d"是指转化为yyyy-mm-dd形式'"n"是指转化为yyyy-mm-dd hh:mm形式'"s"是指转化为yyyy-mm-dd hh:mm:ss形式'"long"是指转化为yyyy年mm月dd日的形式'"no"是指转化为yyyymmdd的形式'"short"是指转化为yymmdd的形式'"t"是指转化为yymmdd hh:mm的形式'-------------------------dim ls_date,ls_getstrif isnull(l) or trim(l)="" then l="s"if isdate(datetime) thenls_date=cstr(datetime)'writelnls_datels_getstr=DatePart("yyyy",cdate(ls_date))ls_getstr=ls_getstr & "-" & wf_ctonstr(DatePart("m",cdate(ls_date)),2)ls_getstr=ls_getstr & "-" & wf_ctonstr(DatePart("d",cdate(ls_date)),2)if l="d" then wf_DateToChar=ls_getstrls_getstr=ls_getstr & " " & wf_ctonstr(DatePart("h",cdate(ls_date)),2)ls_getstr=ls_getstr & ":" & wf_ctonstr(DatePart("n",cdate(ls_date)),2)if l="n" then wf_DateToChar=ls_getstrls_getstr=ls_getstr & ":" & wf_ctonstr(DatePart("s",cdate(ls_date)),2)if l="s" then wf_DateToChar=ls_getstrif l="long" then wf_DateToChar=DatePart("yyyy",cdate(ls_date))&"年"&wf_ctonstr(DatePart("m",cdate(ls_date)),2)&"月"&wf_ctonstr(DatePart("d",cdate(ls_date)),2)&"日"if l="no"then wf_DateToChar=DatePart("yyyy",cdate(ls_date))&wf_ctonstr(DatePart("m",cdate(ls_date)),2)&wf_ctonstr(DatePart("d",cdate(ls_date)),2)if l="short"then wf_DateToChar=right(DatePart("yyyy",cdate(ls_date)),2)&wf_ctonstr(DatePart("m",cdate(ls_date)),2)&wf_ctonstr(DatePart("d",cdate(ls_date)),2)if l="t" then wf_DateToChar=wf_ctonstr(DatePart("m",cdate(ls_date)),2)&wf_ctonstr(DatePart("d",cdate(ls_date)),2)&" "& wf_ctonstr(DatePart("h",cdate(ls_date)),2)& ":" & wf_ctonstr(DatePart("n",cdate(ls_date)),2)elsewf_DateToChar=Nullend ifend function'----把一位整数转化为两位整数----"1" to "01"function wf_ctonstr(num,n)if not IsNumeric(num) thenwf_ctonstr=numelseif len(cstr(cint(num)))>=n thenwf_ctonstr=cstr(cint(num))elsewf_ctonstr="0"&cstr(cint(num))while len(wf_ctonstr)关闭本页
相关信息· Hard Hat Linux 2.0成为StrongARM的操作系统的一个实例
· 一目了然――热键设置小专家
· Community 学习――数据库结构1
· Shawn上1周的流水帐
67880
39057
