尝试了这一点
Option Compare Database
Option Explicit
Private Declare Function GetTimeZoneInformation Lib "kernel32" (lpTimeZoneInformation As TimeZoneInfo) As Long
Private Type SystemTime
intYear As Integer
intMonth As Integer
intwDayOfWeek As Integer
intDay As Integer
intHour As Integer
intMinute As Integer
intSecond As Integer
intMilliseconds As Integer
End Type
Private Type TimeZoneInfo
lngBias As Long
intStandardName(32) As Integer
intStandardDate As SystemTime
intStandardBias As Long
intDaylightName(32) As Integer
intDaylightDate As SystemTime
intDaylightBias As Long
End Type
Public Function GetUTCOffset() As Date
Dim lngRet As Long
Dim udtTZI As TimeZoneInfo
lngRet = GetTimeZoneInformation(udtTZI)
GetUTCOffset = udtTZI.lngBias/60/24
End Function
我在这里找到:
http://www.dbforums.com/microsoft-access/1000377-now-users-using-different-time-zones.html
几乎没有。这确实会为我正确计算UTC偏移量,但不适用夏令时。 因此,我校正的时间戳从真正的UTC时间开始1小时。 –
这是一个屁股疼痛,但尝试在这里找到的解决方案:http://stackoverflow.com/a/130879/1504882 – Elias
任何建议添加DST住宿? –