sensorlogger icon indicating copy to clipboard operation
sensorlogger copied to clipboard

Set timezone

Open flo269 opened this issue 7 years ago • 4 comments

My Nextcloud (12 stable, Ubuntu 16.04) instance is set to UTC+2.

Expected behavior: sensorloger displays times in UTC+2.

Actual behavior: sensorloger displays times in UTC only.

screen shot 2017-07-07 at 14 28 15

flo269 avatar Jul 07 '17 12:07 flo269

As this is still an ALPHA release, there are many to dos pending and bugs to fix. One of those todos is called "Timesettings" :-)

alexstocker avatar Jul 08 '17 08:07 alexstocker

:-) totally understood! Just wanted to write it down for future reference... Thanks for all this so far!!

flo269 avatar Jul 08 '17 09:07 flo269

As far as I understand, sensorlogger uses plain php date() to fill in the relevant date and time information for each sensor log report. If the server's php date is UTC, we fill in UTC date.

I guess proper and simplest workflow here would be:

  • Always fill in UTC date in the database (with a check, if the server's time is really UTC)
  • Use this API: https://github.com/nextcloud/server/blob/master/lib/private/DateTimeZone.php#L55 API to adjust date/time in json sent out to browser.

@alexstocker If that's okay, I can give it a try and implement it.

nekromant avatar Dec 26 '17 11:12 nekromant

Thanx @nekromant. I would appreciate. Any contribution welcome!

alexstocker avatar Dec 27 '17 09:12 alexstocker