Time Zone Problem

Use this forum to discuss issues related to the SD-JSON service.

Time Zone Problem

Postby williamk305 » Sat Jun 25, 2016 6:35 pm

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
williamk305
 
Posts: 3
Joined: Sat Jun 25, 2016 3:04 pm

Re: Time Zone Problem

Postby williamk305 » Sat Jul 02, 2016 11:22 am

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.
williamk305
 
Posts: 3
Joined: Sat Jun 25, 2016 3:04 pm

Re: Time Zone Problem

Postby rkulagow » Sat Jul 02, 2016 1:23 pm

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.
rkulagow
SD Staff
 
Posts: 893
Joined: Tue Aug 14, 2007 3:15 pm

Re: Time Zone Problem

Postby williamk305 » Sat Jul 02, 2016 5:42 pm

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.
williamk305
 
Posts: 3
Joined: Sat Jun 25, 2016 3:04 pm

Re: Time Zone Problem

Postby rmeden » Sat Jul 02, 2016 11:45 pm

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
rmeden
SD Board Member
 
Posts: 1495
Joined: Tue Aug 14, 2007 2:31 pm
Location: Cedar Hill, TX


Return to SD-JSON service

Who is online

Users browsing this forum: No registered users and 2 guests

cron