Time zone property

Hi All,

How can we get timezone like UTC, ET, CT, PT using analysis or property.

Thanks

https://developer.bigfix.com/relevance/search/?query=time%20zone

Hi trn,
I saw that link but can you help me on relevance

Thanks

You can easily return the timezone offset but not easy to convert to actual “name” of the timezone, especially with the daylight savings all over the place and any country doing whatever it wants…

q: (“GMT” & (local time zone as string))
A: GMT-0500
T: 0.530 ms

If you insist on doing it then you will need to write your own code here is pseudo-example:

(if (daylight savings) then (if (it = “GMT-0500”) then (“Central Daylight Time”) else if…) else (if (it = “GMT-0500”) then (“Eastern Standard Time”) else if…)) of (“GMT” & (local time zone as string))

Can’t give you exact code cause it’s not easy at all to determine if daylight savings is on (as I mentioned, that is political thing, not mathematical/reliable) and even harder on all different OS platforms…

You don’t say what the OS is - this is important because the Bigfix inspectors don’t natively tell you anything other than the time offset resulting from the timezone and date.

So you need to dig into the machine configuration to get the timezone.

On Windows you can look at the registry - specifically HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation

Mac & Linux will have that configuration information available, but if you need that you’ll have to do it yourself or wait for a Mac/Linux person to wander by.

Is there any possibility to get time zone using relevance ?

Thanks

Per the question above, for which OSes? :slight_smile:

I wonder too if the following may help: Time zone analysis

Timezone names are a hellstew of inconsistency because they’re not computable. Timezones are political boundaries, not geographic. Political bodies and and do change time zones for a given geography – surprisingly often and without notice. If you’d like to have your brain broken, I recommend Your Calendrical Fallacy.

The only valid computation is offset from UTC, which is provided by the local time zone inspector.

1 Like