格式化日期
希望这个能用得到,呵呵!到家后试验下。
'================格式化日期开始===================
DATE_SEPARATOR = "-"
Function Format_DateTime(DateTimeStr, dt_Format)
If IsDate(DateTimeStr) Then
Select Case dt_Format
Case 1
Format_DateTime = Year(DateTimeStr) & DATE_SEPARATOR & left("00", 2-Len(Month(DateTimeStr)))&Month(DateTimeStr) & DATE_SEPARATOR & left("00", 2-Len(Day(DateTimeStr)))&Day(DateTimeStr)
Case Else
Format_DateTime = DateTimeStr
End Select
End If
End Function
'================格式化日期结束===================