-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dates: UTC vs LocalDateTime #56
Comments
#55 switched the log time format to UTC which also paves the way for switching timezones on the UI (as per @hobie22670 use case) |
Additional info regarding time zones. I currently have multiple servers / clients with probes running in Northern Michigan (all in EST) UTC +5. I'm monitoring these from within the same time zone and charts showing local time is perfect. |
Looks like chartjs doesn't support changing timezone (chartjs/Chart.js#4334 ) but we could map the UTC values coming from the server to an offset value set by the user. So, if we know the browsers offset, we could reverse and overwrite the raw chart data. Taking a source UTC of The other option would be to globally set the
This has the advantage of automatically affecting the logs 👍. |
One thing I don't like when the server is not in a UTC zone. I'd prefer the default to be in the server's timezone. |
…ng API change as temperatures PUT requests now send over the host's UTC offset as well as the host's name
…on/temperature-machine-ui) #56 display utc offset under live connections
…ne) is used to work out the index offset to write temperatures to the RRD and not just the host name
…ne) is used to work out the index offset to write temperatures to the RRD and not just the host name
This is basically fixed in 18bdc61 now. A timezone picker is available that affects the log page and main chart. Remaining issues:
I'll leave the issue open for now until we resolve the above. It looks like this: |
Default Timezone to Server's TimezoneThis is a bit trickier than I thought. I'm in two minds how to do this. I don't really want to modify the Options:
|
Went for the server returning a |
Some of the system uses UTC whilst others local data times.
Log is generated by Log4J and the pattern
%d{yyyy-MM-dd HH:mm:ss:SSS}
and so local time.Logs
Instant
is UTC and theLogParser
andLogMessage
useInstant
, so it probably makes sense to convert the log code to useLocalDateTime
.Or, we could store UTC in the log file (add a
Z
to thelog4j.properties
) and present in the local time zone of the client.Charts / RRD
RRD itself will use UTC as it uses
System.currentTimeMillis
under the covers (RrdUpdate.scala
L16) with the below.The
/temperatures
endpoint returns seconds for the event time (used by the main current temperature display) whereas the/temperature.json
endpoint returns millis (for the chart). Both as UTC.The text was updated successfully, but these errors were encountered: