History timestamps in UTC and not local TZ

Report & discuss bugs found in SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
Hossy
Newbie
Newbie
Posts: 7
Joined: May 8th, 2017, 7:50 am

History timestamps in UTC and not local TZ

Post 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.
User avatar
safihre
Administrator
Administrator
Posts: 5338
Joined: April 30th, 2015, 7:35 am
Contact:

Re: History timestamps in UTC and not local TZ

Post by safihre »

It uses the time zone of the browser to calculate those, not sure what is going wrong.
What browser are you using?
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Hossy
Newbie
Newbie
Posts: 7
Joined: May 8th, 2017, 7:50 am

Re: History timestamps in UTC and not local TZ

Post by Hossy »

Chrome Version 60.0.3112.113 (Official Build) (64-bit)
running on Windows 7
also set to Central time
User avatar
safihre
Administrator
Administrator
Posts: 5338
Joined: April 30th, 2015, 7:35 am
Contact:

Re: History timestamps in UTC and not local TZ

Post 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
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Hossy
Newbie
Newbie
Posts: 7
Joined: May 8th, 2017, 7:50 am

Re: History timestamps in UTC and not local TZ

Post 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.
User avatar
safihre
Administrator
Administrator
Posts: 5338
Joined: April 30th, 2015, 7:35 am
Contact:

Re: History timestamps in UTC and not local TZ

Post by safihre »

Maybe someone else knows a solution..
Without reports from others, I have to consider this system/setup specific.
All browsers were tested.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Hossy
Newbie
Newbie
Posts: 7
Joined: May 8th, 2017, 7:50 am

Re: History timestamps in UTC and not local TZ

Post by Hossy »

Can you provide info on how SABnzbd is getting the timezome from the browser? Maybe that process specifically can be tested separately.
clarenceb5
Newbie
Newbie
Posts: 3
Joined: May 10th, 2012, 2:50 pm
Location: Canada

Re: History timestamps in UTC and not local TZ

Post 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)
User avatar
safihre
Administrator
Administrator
Posts: 5338
Joined: April 30th, 2015, 7:35 am
Contact:

Re: History timestamps in UTC and not local TZ

Post 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.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: History timestamps in UTC and not local TZ

Post 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?
clarenceb5
Newbie
Newbie
Posts: 3
Joined: May 10th, 2012, 2:50 pm
Location: Canada

Re: History timestamps in UTC and not local TZ

Post 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
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: History timestamps in UTC and not local TZ

Post 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) ...
User avatar
safihre
Administrator
Administrator
Posts: 5338
Joined: April 30th, 2015, 7:35 am
Contact:

Re: History timestamps in UTC and not local TZ

Post 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.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
safihre
Administrator
Administrator
Posts: 5338
Joined: April 30th, 2015, 7:35 am
Contact:

Re: History timestamps in UTC and not local TZ

Post by safihre »

Sorry guys, you were absolutely right.

This bug will be fixed in 2.3.1!
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Post Reply