Closed stevewhiting closed 9 years ago
Matt, thanks a lot for your work on this. Hugely helpful.
I ran into an issue where my systems were reporting metrics an hour in the future to graphite. Being the deep thinker I am, I just subtracted an hour:
$UnixTime = ($UnixTime - 3600);
In the middle of setting this up on some systems, I noticed that this reports "PST" even though we're currently in daylight savings time:
PS C:\WINDOWS\system32> [System.TimeZoneInfo]::LOCAL.id Pacific Standard Time
So, I removed my subtract-an-hour solution and added this to determine my local timezone instead:
# determine if we're in dst $wmisys = get-wmiobject "Win32_ComputerSystem" $dst = $wmisys.DaylightInEffect if ($dst -eq 'True') { $LocalTimeZone = [TimeZone]::CurrentTimeZone.daylightname } else { $LocalTimeZone = [TimeZone]::CurrentTimeZone.standardname }
Its now "working", and my metrics show up correctly in graphite. Am I completely off track with this?
It might be better to send UTC times to graphite, and ignore timezones entirely.
Perfect, thanks for the update.
Matt, thanks a lot for your work on this. Hugely helpful.
I ran into an issue where my systems were reporting metrics an hour in the future to graphite. Being the deep thinker I am, I just subtracted an hour:
In the middle of setting this up on some systems, I noticed that this reports "PST" even though we're currently in daylight savings time:
So, I removed my subtract-an-hour solution and added this to determine my local timezone instead:
Its now "working", and my metrics show up correctly in graphite. Am I completely off track with this?