找到了:
function time_type(tvar,tt)
dim ttt,d_year,d_month,d_day,d_hour,d_minute,d_second
ttt=tvar
if ttt="" or isnull(ttt) then ttt=now_time
if not(isdate(ttt)) then
time_type=""
exit function
end if
d_year=year(ttt)
d_month=month(ttt)
if len(d_month)<2 then d_month="0"&d_month
d_day=day(ttt)
if len(d_day)<2 then d_day="0"&d_day
d_hour=hour(ttt)
if len(d_hour)<2 then d_hour="0"&d_hour
d_minute=minute(ttt)
if len(d_minute)<2 then d_minute="0"&d_minute
d_second=second(ttt)
if len(d_second)<2 then d_second="0"&d_second
select case tt
case 1 '2000-10-10 23:45:45
time_type=d_year&"-"&d_month&"-"&d_day&" "&d_hour&":"&d_minute&":"&d_second
case 11 '20001010234545
time_type=d_year&d_month&d_day&d_hour&d_minute&d_second
case 2 '年(4)-月-日 时:分:秒
time_type=d_year&"年"&d_month&"月"&d_day&"日 "&d_hour&"时"&d_minute&"分"&d_second&"秒"
case 3 '10-10 23:45
time_type=d_month&"-"&d_day&" "&d_hour&":"&d_minute
case 4 '2003-10-10
time_type=d_year&"-"&d_month&"-"&d_day
case 5 '2003年10月10日
time_type=d_year&"年"&d_month&"月"&d_day&"日"
case else
time_type=ttt
end select
end function
function code_js(strers,tt)
dim strer
strer=trim(strers)
if strer="" or isnull(strer) then
code_js=""
exit function
end if
if ishealth then
strer=code_health(strer)
end if
strer=replace(strer,"\","\\")
strer=replace(strer,chr(39),"'") '单引号
'strer=replace(strer,chr(39),"\'")
strer=replace(strer,chr(34),""") '双引号
'strer=replace(strer,chr(34),"\""")
select case tt
case 0
'strer=replace(strer,vbcrlf,"") '回车
strer=replace(strer,chr(10),"")
strer=replace(strer,chr(13),"")
case 1
'strer=replace(strer,vbcrlf,"\n") '回车
strer=replace(strer,chr(10),"\n")
strer=replace(strer,chr(13),"")
end select
if right(strer,1)="\" then
strer=strer&"n"
end if
code_js=strer
end function
——————————————————————————————————————
引用:
n_topic=code_js(n_topic,1)