说明
下面例子利用 FormatDateTime 函数把表达式格式化为长日期型并且把它赋给 MyDateTime:
Function GetCurrentDate
'FormatDateTime 把日期型格式化为长日期型。
GetCurrentDate = FormatDateTime(Date, 1)
End Function
function dateOut(dateInput)
on error resume next
if trim(dateInput) <> "" then
yy = year(dateInput)
mm = month(dateInput)
dd = day(dateInput)
hh = hour(dateInput)
min = minute(dateInput)
dateOut = mm & "-" & dd & "-" & yy & " " & hh & ":" & min
else
dateOut = ""
end if
end function