Changing Date/Time to conform to Zulu Date/Time

  • Thread starter Thread starter Micheal Palmer
  • Start date Start date
Hi Michael,

UT/Zulu time is the same as Greenwich MeanTime (GMT) which
funnily enough we still use here in the UK ;-). I suppose
you could change your date/time settings in control panel
to GMT but that would affect the whole PC. Another option
could be to work out the difference (+/- hrs) of your time
zone between GMT using DateAdd().

hth

chas
 
I've found that setting the computer to Greenwich Mean Time doesn't work because Great
Britton observes Daylight Savings Time. Even if you uncheck the box, the conversion still
shows up somewhere down deep, it just doesn't make the change on the displayed clock. We
have had this cause problems on some programs that synched across computers. The work
around was to use the Casablanca/Monrovia time zone. It is also UTC+0, but they don't
observe DST and so the problem doesn't occur.

To get UTC time you need to make some API calls to get your time zone offset and DST
status. You can then calculate UTC. The following may help with this:

http://www.mvps.org/access/api/api0024.htm
http://www.mvps.org/access/api/api0039.htm

Also, the GetSystemTime API call will return UTC time based on your current system's time.
Here is an example from Visual Basic.

Private Declare Sub GetSystemTime Lib "kernel32" (lpSystemTime As SYSTEMTIME)
Private Type SYSTEMTIME
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

Private Sub Form_Load()
'KPD-Team 1998
'URL: http://www.allapi.net/
'(e-mail address removed)
Dim SysTime As SYSTEMTIME
'Set the graphical mode to persistent
Me.AutoRedraw = True
'Get the system time
GetSystemTime SysTime
'Print it to the form
Me.Print "The System Date is:" & SysTime.wMonth & "-" & SysTime.wDay & "-" &
SysTime.wYear
Me.Print "The System Time is:" & SysTime.wHour & ":" & SysTime.wMinute & ":" &
SysTime.wSecond
End Sub
 
Back
Top