|
控制面板里重新设日期格式:或者用下面的代码试试rivate Const LOCALE_SSHORTDATE = &H1FPrivate Const LOCALE_ILZERO = &H12
Private Const LOCALE_STIMEFORMAT = &H1003Private Declare Function GetSystemDefaultLCID _
Lib "kernel32" () As LongPrivate Declare Function SetLocaleInfo Lib _
"kernel32" Alias "SetLocaleInfoA" ( _
ByVal Locale As Long, _
ByVal LCType As Long, _
ByVal lpLCData As String) As BooleanPublic Sub setSystemDateFormat() Dim lngLocale As Long lngLocale = GetSystemDefaultLCID() If SetLocaleInfo(lngLocale, _
LOCALE_SSHORTDATE, _
"yyyy/MM/dd") = _
False Then
' Handle error, possibly by writing it
' to a server error log
Debug.Print "设置系统日期格式错误!"
End If
If SetLocaleInfo(lngLocale, _
LOCALE_STIMEFORMAT, _
"HH:mm:ss") = False Then
Debug.Print "设置系统时格式错误"
End If
SetLocaleInfo lngLocale, LOCALE_ILZERO, "1"
End Sub
|
|