Page 1 of 1

Time Zone Problem

PostPosted: Sat Jun 25, 2016 6:35 pm
by williamk305
I can't seem to figure out how to get the correct time zone.
When I run tv_grab_sd_json the first line says time zone -0400 which is correct but the data downloaded has +0000
making all the times off by 4 hrs.
With the legacy grabber I could correct it by placing timeoffset: -0400 in the .conf file but that doesn't work with this one.
What am I doing wrong?
This is what I run: C:\XMLTVJson\xmltv.exe tv_grab_sd_json --days 13 --output tvguide.xml

Re: Time Zone Problem

PostPosted: Sat Jul 02, 2016 11:22 am
by williamk305
I'm losing my mind over this.
I just discovered that times received from the WinTV api are also 4 hrs off but show up correctly in their program.
Date and time on my computer are correct. The time zone is set to UTC -0500 Eastern US and Canada.
Something is changing the times in my program as they are being read but I can't figure out what.

Re: Time Zone Problem

PostPosted: Sat Jul 02, 2016 1:23 pm
by rkulagow
Everything in the JSON service is sent in +0000, so any conversion to localtime is either in your grabber, or in your application.

What you don't want is for it to happen in your grabber _and_ your application.

Re: Time Zone Problem

PostPosted: Sat Jul 02, 2016 5:42 pm
by williamk305
Thanks.
That clears that part up. I correct the time with my code.
Not sure about the WinTV api. I set the time myself but when I read it back it comes back 4 hours off.
All I can think of is the api is changing it for some reason.

Re: Time Zone Problem

PostPosted: Sat Jul 02, 2016 11:45 pm
by rmeden
As RobertK said, all our stuff is in UTC.

Many XMLTV grabbers can generate a local offset "like 00:00:00 -0400" to make it more readable. A properly written application should take the offset into account when parsing the timestamp so it doesn't matter. Some applications are not written properly, so you need to set a grabber time-offset for the application to work correctly. (and change it with DST).

RobertE