Page 1 of 1

History timestamps in UTC and not local TZ

Posted: September 28th, 2017, 12:06 am
by Hossy
I'm currently running SABnzbd version 2.3.0 in docker using linuxserver/sabnzbd:latest. I'm not sure when this changed, but the history section is showing the completed timestamps in UTC instead of the system timezone. TZ environment variable is set (TZ=US/Central). Scheduler is working fine and respecting the local timezone, so it seems the application is aware of the local timezone, but is specifically using UTC for the history section.

Re: History timestamps in UTC and not local TZ

Posted: September 28th, 2017, 1:23 am
by safihre
It uses the time zone of the browser to calculate those, not sure what is going wrong.
What browser are you using?

Re: History timestamps in UTC and not local TZ

Posted: September 28th, 2017, 7:59 am
by Hossy
Chrome Version 60.0.3112.113 (Official Build) (64-bit)
running on Windows 7
also set to Central time

Re: History timestamps in UTC and not local TZ

Posted: September 28th, 2017, 8:12 am
by safihre
Then the input must be somehow wrong, it uses timestamps generated by the host.
What if you change the TZ to something else?

Seems to be specific to this combination with the docker, if SABnzbd was always displaying wrong times the forums would have been overloaded with complaints :P

Re: History timestamps in UTC and not local TZ

Posted: September 28th, 2017, 10:15 pm
by Hossy
So, I didn't change TZ, but I did try other browsers. Doesn't render at all in IE. :-) However, in Firefox ESR 45.6.0, the time shows up correctly. So, it's definitely something with Chrome.

EDIT: I restarted Chrome to complete an update. It is now up to date running Version 61.0.3163.100 (Official Build) (64-bit). Same problem.

Re: History timestamps in UTC and not local TZ

Posted: September 29th, 2017, 3:56 am
by safihre
Maybe someone else knows a solution..
Without reports from others, I have to consider this system/setup specific.
All browsers were tested.

Re: History timestamps in UTC and not local TZ

Posted: September 29th, 2017, 7:48 am
by Hossy
Can you provide info on how SABnzbd is getting the timezome from the browser? Maybe that process specifically can be tested separately.

Re: History timestamps in UTC and not local TZ

Posted: September 29th, 2017, 8:55 am
by clarenceb5
I am also seeing an incorrect completed time in the history tab, 4 hours ahead of my local time when using Chrome, Edge or Firefox.

Running SABNZBD v2.3.0 [ba7d906] installed on a Windows 10 PC.
Chrome browser is Version 61.0.3163.100 (Official Build) (64-bit)
Edge browser is Version 40.15063.0.0
Firefox broswer is Version 53.0 (32-bit)

Re: History timestamps in UTC and not local TZ

Posted: September 29th, 2017, 10:22 am
by safihre
Sabnzbd uses momentJS that parses the timestamp generated by your computer. That one should be in UTC, unless something weird is going on. I am not sure how momentjs parses the timestamp to determine local time to be honest.

Re: History timestamps in UTC and not local TZ

Posted: September 29th, 2017, 11:25 am
by sander
clarenceb5 wrote: September 29th, 2017, 8:55 am I am also seeing an incorrect completed time in the history tab, 4 hours ahead of my local time when using Chrome, Edge or Firefox.
4 hours ... in which local timezone are you? And what is that compared to GMT? And is your SABnzbd running on the same machine? On the same LAN?

And what do
https://whatismytimezone.com/ and
https://momentjs.com/timezone/ (half the page, right above the world map, without touching the world map)
tell you?

Re: History timestamps in UTC and not local TZ

Posted: September 29th, 2017, 12:29 pm
by clarenceb5
Local timezone is Eastern Time.
GMT is 4 hours ahead of Eastern Time.
SABnzbd running on same machine as what? On the same LAN as what? I'm testing the browsers on the same Windows 10 PC where SABnzbd is installed and running.

Result from whatismytimezone dot com:
The current time is Fri Sep 29 2017 13:24:40 GMT-0400 (Eastern Daylight Time)
The GMT current time is Fri, 29 Sep 2017 17:24:40 GMT
You are currently at GMT+/-4:00

Result from momentjs dot com/timezone/:
America/Toronto
01:24 pm EDT

Re: History timestamps in UTC and not local TZ

Posted: September 29th, 2017, 12:54 pm
by sander
Ah, I can confirm, and with both Chrome and Firefox.: Download History says "2017-09-29 17:39" (= time in GMT), whereas it should say "2017-09-29 19:39" (correct time, I'm in GMT+2) ...

Re: History timestamps in UTC and not local TZ

Posted: September 29th, 2017, 3:11 pm
by safihre
Aah now that's interesting and something I did not thoroughly test. I only tested with the default setting of "x minutes/seconds ago" style of display.

Sorry about that, will investigate when I'm near a computer again Sunday.

Re: History timestamps in UTC and not local TZ

Posted: September 30th, 2017, 10:53 am
by safihre
Sorry guys, you were absolutely right.

This bug will be fixed in 2.3.1!