'---------------------------------------------------------------------------
Function AHshGetServerCurrentDate
Dim strTmp, iYear,iMonth,iDate
iYear = Year(Date)
iMonth = Month(Date)
iDate = Day(Date)
strTmp = CStr(iYear) & "-"
If iMonth < 10 Then
strTmp = strTmp & "0" & Cstr(iMonth) & "-"
Else
strTmp = strTmp & Cstr(iMonth) & "-"
End If
If iDate < 10 Then
strTmp = strTmp & "0" & Cstr(iDate)
Else
strTmp = strTmp & Cstr(iDate)
End If
AHshGetServerCurrentDate = strTmp
End Function
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10294527/viewspace-124737/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/10294527/viewspace-124737/
博客展示了一段日期格式化的代码,通过获取当前年、月、日,对月和日小于10的情况进行补零处理,最终将日期格式化为特定字符串。代码实现了日期格式化功能。
1068

被折叠的 条评论
为什么被折叠?



