VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Uses system time and time zone information to return current time in internet time format (@time be

by Michael A. Seel (4 Submissions)
Category: Miscellaneous
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Wed 15th November 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

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



    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

Download this snippet    Add to My Saved Code

Uses system time and time zone information to return current time in internet time format (@time be Comments

No comments have been posted about Uses system time and time zone information to return current time in internet time format (@time be. Why not be the first to post a comment about Uses system time and time zone information to return current time in internet time format (@time be.

Post your comment

Subject:
Message:
0/1000 characters