LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieve System Time Zone Offset?

Hi, I'm doing some GPS emulation and need to retrieve the system Time Zone Offset in (Hour and Minute). For example if Mountain time zone offset hour = -7 and Minute = 00. Is this information possible to get in Labview?

 

Thanks.

0 Kudos
Message 1 of 4
(2,591 Views)

Hello QRP,

 

Yes, it can be done, but this way is not very elegant. It will get the GMT offset that your PC has as its current setting.

 

Use Format Date/TIme String with a format string of "%z". The output is the offset as a STRING formatted HH:MM:SS

 

Break the string apart with Scan From String to get the individual elements, or by using "%t" as the format, get the offset in seconds.

 

Rod.

 

EDIT: There shouldn't be a smiley in the time format above, It's "HH : MM : SS" but ignore the spaces!

Message 2 of 4
(2,573 Views)

Thanks!

I nearly got mad playing around with "IsUTC?"-Flags and other stuff. Tried registry access (till I ceased working as admin in WIN7), even played with .NET calls.

0 Kudos
Message 3 of 4
(2,404 Views)

Capture.PNG

A Small mod to code I had hanging around does the trick nicely

 

Whoops I forgot to change the display format of the Zone Offset to "Relative time HH:MM:SS"


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 4
(2,391 Views)