Page 1 of 1

Timezon in xmltv

PostPosted: Sat Oct 08, 2011 9:24 am
by cYrus
Dvblink v4 has a strange issue with xmltv timezone. If i have a start-tag with a timezone of +0200 it works correctly. If the timezone is +0100 it still works as expected. BUT if the timezone is +0000 or if there's no timezone at all it automatically uses a +0200 timezone.

How can i use an xmltv-file which doesn't need timezone correction?

Re: Timezon in xmltv

PostPosted: Mon Oct 17, 2011 10:06 am
by cYrus
hey oberon,

how did you implement the time-parser for the xml-files? i don't want timezone adjustments.

this doesn't work:
<programme start="20080715003000 +0000" stop="20080715010000 +0000" channel="I10436.labs.zap2it.com">

that doesn't work as well:
<programme start="20080715003000" stop="20080715010000" channel="I10436.labs.zap2it.com">

Re: Timezon in xmltv

PostPosted: Mon Oct 17, 2011 10:16 am
by Oberon
What exactly does not work with this line:
<programme start="20080715003000 +0000" stop="20080715010000 +0000" channel="I10436.labs.zap2it.com">
?

DVBLink xmltv parser expects UTC times (according to xmltv spec). So if you are in timezone +3 hours for example and program starts at 20:00 it should be
Code: Select all
programme start="20080715200000 +0300"

It might be that when timezone in your xmltv file is +0000 then start/stop times are shifted and are not in UTC anymore.

In any case a workaround can be to use channels.xml file that is in the xmltv source directory:
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<channels>
<!-- list of channels. Each channel is identified by its ID that should be the same as in xmltv file -->      

<!-- (Optional) This is special entry, which applies to all channels (unless they are specified explicitely below) -->      
   <channel id="6AAF3CCD-0EB8-4346-9D87-799217A283EA">
      <offset>0</offset>
   </channel>

<!-- <channel id="channel id"> -->      
<!-- Optional. time offset for a channel in minutes (can be either positive or negative) -->      
<!-- <offset>time offset in minutes</offset> -->      
<!-- Optional. Defines whether this channel is HDTV -->      
<!--  <hdtv/> -->      
</channels>

Re: Timezon in xmltv

PostPosted: Mon Oct 17, 2011 5:16 pm
by cYrus
Oberon wrote:What exactly does not work with this line:
<programme start="20080715003000 +0000" stop="20080715010000 +0000" channel="I10436.labs.zap2it.com">
?


with such a line, dvblink uses a timezone-shift of +0200. (that happens to be the same amount of time as the UTC-shift: i'm from Switzerland which has UTC+2)

BUT if i'm using e.g.

<programme start="20080715003000 +0100" stop="20080715010000 +0100" channel="I10436.labs.zap2it.com">
-> this shifts the time exactly one hour to the future. (that's what i've expected)

<programme start="20080715003000 +0200" stop="20080715010000 +0200" channel="I10436.labs.zap2it.com">
-> this shifts the time exactly two hour to the future. (that's what i've expected too)

<programme start="20080715003000 +0000" stop="20080715010000 +0000" channel="I10436.labs.zap2it.com">
-> this shifts the time exactly two hour to the future. (that's what i don't understand. it looks like a bug)


DVBLink xmltv parser expects UTC times (according to xmltv spec). So if you are in timezone +3 hours for example and program starts at 20:00 it should be
Code: Select all
programme start="20080715200000 +0300"

It might be that when timezone in your xmltv file is +0000 then start/stop times are shifted and are not in UTC anymore.

In any case a workaround can be to use channels.xml file that is in the xmltv source directory:
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<channels>
<!-- list of channels. Each channel is identified by its ID that should be the same as in xmltv file -->      

<!-- (Optional) This is special entry, which applies to all channels (unless they are specified explicitely below) -->      
   <channel id="6AAF3CCD-0EB8-4346-9D87-799217A283EA">
      <offset>0</offset>
   </channel>

<!-- <channel id="channel id"> -->      
<!-- Optional. time offset for a channel in minutes (can be either positive or negative) -->      
<!-- <offset>time offset in minutes</offset> -->      
<!-- Optional. Defines whether this channel is HDTV -->      
<!--  <hdtv/> -->      
</channels>


well that would be a workaround but it looks like a lot of work if you use a mix of dvb-epg and xmltv-epg.

Re: Timezon in xmltv

PostPosted: Tue Oct 18, 2011 7:52 am
by Oberon
We will have a look.

Re: Timezon in xmltv

PostPosted: Wed Oct 19, 2011 10:49 am
by Oberon
Just checked.
These two lines:
Code: Select all
<programme start="20080715003000 +0200" stop="20080715010000 +0200" channel="I10436.labs.zap2it.com">
<programme start="20080715003000 +0000" stop="20080715010000 +0000" channel="I10436.labs.zap2it.com">

produce different results - e.g. shifted by two hours. Can it be some other factors that play on your machine? Have you changed the timezone on your PC while experimenting?