'============================================
'格式化时间(显示)
'参数:n_Flag
'1:"yyyy-mm-ddhh:mm:ss"
'2:"yyyy-mm-dd"
'3:"hh:mm:ss"
'4:"yyyy年mm月dd日"
'5:"yyyymmdd"
'============================================
FunctionFormat_Time(s_Time,n_Flag)
Dimy,m,d,h,mi,s
Format_Time=""
IfIsDate(s_Time)=FalseThenExitFunction
y=cstr(year(s_Time))
m=cstr(month(s_Time))
Iflen(m)=1Thenm="0"&m
d=cstr(day(s_Time))
Iflen(d)=1Thend="0"&d
h=cstr(hour(s_Time))
Iflen(h)=1Thenh="0"&h
mi=cstr(minute(s_Time))
Iflen(mi)=1Thenmi="0"&mi
s=cstr(second(s_Time))
Iflen(s)=1Thens="0"&s
SelectCasen_Flag
Case1
'yyyy-mm-ddhh:mm:ss
Format_Time=y&"-"&m&"-"&d&""&h&":"&mi&":"&s
Case2
'yyyy-mm-dd
Format_Time=y&"-"&m&"-"&d
Case3
'hh:mm:ss
Format_Time=h&":"&mi&":"&s
Case4
'yyyy年mm月dd日
Format_Time=y&"年"&m&"月"&d&"日"
Case5
'yyyymmdd
Format_Time=y&m&d
EndSelect
EndFunction