- Home
·
- Miscellaneous
·
- Uses system time and time zone information to return current time in internet time format (@time be
Uses system time and time zone information to return current time in internet time format (@time be
Uses system time and time zone information to return current time in internet time format (@time beats)
API Declarations
wYear As Integer
wMonth As Integer
wDayOfWeek As Integer
wDay As Integer
wHour As Integer
wMinute As Integer
wSecond As Integer
wMilliseconds As Integer
End Type
Type TIME_ZONE_INFORMATION
Bias As Long
StandardName As String * 64
StandardDate As SYSTEMTIME
StandardBias As Long
DaylightName As String * 64
DaylightDate As SYSTEMTIME
DaylightBias As Long
End Type
Declare Sub GetSystemTime Lib "KERNEL32" (lpSystemTime As SYSTEMTIME)
Declare Function GetTimeZoneInformation Lib "KERNEL32" (lpTimeZoneInformation As TIME_ZONE_INFORMATION) As Long
Rate Uses system time and time zone information to return current time in internet time format (@time be
(1(1 Vote))
Dim TimeZone As TIME_ZONE_INFORMATION, tzTmp As Long, GMTime As SYSTEMTIME
tzTmp = GetTimeZoneInformation(TimeZone) ' Returns '1' for Daylight savings and '2' for Standard
GetSystemTime GMTime 'Get the current GMT
With GMTime
'Calculate beats to nearest millisecond
Beats = ((((CLng(.wHour) + (2 - tzTmp)) * 60 * 60 * 1000) + (CLng(.wMinute) * 60 * 1000) + (CLng(.wSecond) * 1000) + CLng(.wMilliseconds)) / 86400000) * 1000
End With
End Function
Uses system time and time zone information to return current time in internet time format (@time be Comments
No comments yet — be the first to post one!
Post a Comment