Discussion:
[Xmltv-devel] [ xmltv-Bugs-3098768 ] _ch_search: not honoring daylight saving time
SourceForge.net
2012-04-24 19:11:49 UTC
Permalink
Bugs item #3098768, was opened at 2010-10-30 02:27
Message generated for change (Comment added) made by betlit
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=424135&aid=3098768&group_id=39046

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: tv_grab_ch_search
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Patric Mueller (bhaak)
Assigned to: Nobody/Anonymous (nobody)
Summary: _ch_search: not honoring daylight saving time

Initial Comment:
The current CVS version of tv_grab_ch_search has the CET timezone hardcoded:
tv_grab_ch_search.in:148 ## the timezone tv.search.ch lives in is, CET/CEST
tv_grab_ch_search.in:149: my constant $TZ = "+0100";

For the time being this problem will of course resolve itself tonight. :)

----------------------------------------------------------------------

Comment By: Daniel Bittel (betlit)
Date: 2012-04-24 12:11

Message:
finally go this fixed by switching from Date::Manip to DateTime which
handles the DST much nicer (thanks to dekarl for the hint).

----------------------------------------------------------------------

Comment By: Karl Dietz (dekarl)
Date: 2011-03-30 01:48

Message:
Hi Thomi,

here it the code from _pt_meo
use the module
102: use DateTime;

get the time from the data
206: my $starttime = $xpc->findvalue( 'EPG:StartTime', $inprog );
convert text into timestamp
207: my $dtstart = dt_from_string( $starttime );
add timestmap to programme, using XMLTV format (%z is +0100 or +0200
depending on the timestamp)
208: $prog{start} = $dtstart->strftime( '%Y%m%d%H%M%S %z' );

that's the function that converts the time
272: sub dt_from_string
273: {
store parameters into $string, you might want to keep date and time
seperate and use ( $date, $time ) to have two parameters
274: my( $string ) = @_;
split $string into parts of the timestamp source has "YYYY-MM-DD HH:MM:SS"
format. If you keep date/time seperate you can just copy these lines and
split date/time in two steps
275: my($year, $month, $day, $hour, $minute, $second) =
276: ($string =~ m|(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})|);
create timestamp from values
277: my $dt = DateTime->new( year => $year,
278: month => $month,
279: day => $day,
280: hour => $hour,
281: minute => $minute,
if you don't have seconds you can just drop that line
282: second => $second,
the timestamp is in localtime as appropriate for Portugal, Europe/Zurich
would be used for Switzerland
283: time_zone => 'Europe/Lisbon',
284: );
285: return $dt;
286: }



the part in _ch_search is this:
mix $grabDate and the time
409: my $tmp = substr($grabDate,0,4) . substr($grabDate,4,2) .
substr($grabDate,6,2) .(($tv_show->look_down('_tag',
'td'))[0])->as_text();
drop : from the time
410: $tmp =~ s/://;
append fixed time offset
411: my $start = "$tmp"."00 $TZ";
store the start time in the programme
412: $show{start} = $start;


Regards,
Karl

----------------------------------------------------------------------

Comment By: Karl Dietz (dekarl)
Date: 2011-03-30 01:11

Message:
great that you found a workaround that is working for now!
But that fix will break the schedule when you grab for days that are on the
other side of the DST switch.

Can you take a look at _pt_meo? It is converting floating localtime into
specific localtime, too. (and really simple, that's why I'm suggesting it)
That would solve all issues but one. That being invalid localtime in the
guide, like 02:30 when the clock jumps from 01:59 to 03:00.

Regards,
Karl

----------------------------------------------------------------------

Comment By: thomi_ch (thomi_ch)
Date: 2011-03-29 04:52

Message:
hey patric

thanks for your solution/workaround.. fixed it like this.. and also added
this line after #!/usr/bin/perl

use POSIX;

now times are correct ;)...

----------------------------------------------------------------------

Comment By: Patric Mueller (bhaak)
Date: 2011-03-28 12:40

Message:
A workaround I'm using is using
my constant $TZ = strftime("%z",localtime);

This returns the current time zone offset.

This isn't a real solution as the dates after the change of the daylight
saving time are still wrong if they come from a run of the program before
the change of the daylight saving time.

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=424135&aid=3098768&group_id=39046
SourceForge.net
2012-04-30 10:24:11 UTC
Permalink
Bugs item #3098768, was opened at 2010-10-30 02:27
Message generated for change (Comment added) made by dekarl
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=424135&aid=3098768&group_id=39046

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: tv_grab_ch_search
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Patric Mueller (bhaak)
Assigned to: Daniel Bittel (betlit)
Summary: _ch_search: not honoring daylight saving time

Initial Comment:
The current CVS version of tv_grab_ch_search has the CET timezone hardcoded:
tv_grab_ch_search.in:148 ## the timezone tv.search.ch lives in is, CET/CEST
tv_grab_ch_search.in:149: my constant $TZ = "+0100";

For the time being this problem will of course resolve itself tonight. :)

----------------------------------------------------------------------
Comment By: Karl Dietz (dekarl)
Date: 2012-04-30 03:24

Message:
A fix has been commited by betlit.
But now there seems to be some issue/overlap with the exported data, see
the delta at
http://www.crustynet.org.uk/~xmltv-tester/squeeze/nightly/0/result.html#tv_grab_ch_search


----------------------------------------------------------------------

Comment By: Daniel Bittel (betlit)
Date: 2012-04-24 12:11

Message:
finally go this fixed by switching from Date::Manip to DateTime which
handles the DST much nicer (thanks to dekarl for the hint).

----------------------------------------------------------------------

Comment By: Karl Dietz (dekarl)
Date: 2011-03-30 01:48

Message:
Hi Thomi,

here it the code from _pt_meo
use the module
102: use DateTime;

get the time from the data
206: my $starttime = $xpc->findvalue( 'EPG:StartTime', $inprog );
convert text into timestamp
207: my $dtstart = dt_from_string( $starttime );
add timestmap to programme, using XMLTV format (%z is +0100 or +0200
depending on the timestamp)
208: $prog{start} = $dtstart->strftime( '%Y%m%d%H%M%S %z' );

that's the function that converts the time
272: sub dt_from_string
273: {
store parameters into $string, you might want to keep date and time
seperate and use ( $date, $time ) to have two parameters
274: my( $string ) = @_;
split $string into parts of the timestamp source has "YYYY-MM-DD HH:MM:SS"
format. If you keep date/time seperate you can just copy these lines and
split date/time in two steps
275: my($year, $month, $day, $hour, $minute, $second) =
276: ($string =~ m|(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})|);
create timestamp from values
277: my $dt = DateTime->new( year => $year,
278: month => $month,
279: day => $day,
280: hour => $hour,
281: minute => $minute,
if you don't have seconds you can just drop that line
282: second => $second,
the timestamp is in localtime as appropriate for Portugal, Europe/Zurich
would be used for Switzerland
283: time_zone => 'Europe/Lisbon',
284: );
285: return $dt;
286: }



the part in _ch_search is this:
mix $grabDate and the time
409: my $tmp = substr($grabDate,0,4) . substr($grabDate,4,2) .
substr($grabDate,6,2) .(($tv_show->look_down('_tag',
'td'))[0])->as_text();
drop : from the time
410: $tmp =~ s/://;
append fixed time offset
411: my $start = "$tmp"."00 $TZ";
store the start time in the programme
412: $show{start} = $start;


Regards,
Karl

----------------------------------------------------------------------

Comment By: Karl Dietz (dekarl)
Date: 2011-03-30 01:11

Message:
great that you found a workaround that is working for now!
But that fix will break the schedule when you grab for days that are on the
other side of the DST switch.

Can you take a look at _pt_meo? It is converting floating localtime into
specific localtime, too. (and really simple, that's why I'm suggesting it)
That would solve all issues but one. That being invalid localtime in the
guide, like 02:30 when the clock jumps from 01:59 to 03:00.

Regards,
Karl

----------------------------------------------------------------------

Comment By: thomi_ch (thomi_ch)
Date: 2011-03-29 04:52

Message:
hey patric

thanks for your solution/workaround.. fixed it like this.. and also added
this line after #!/usr/bin/perl

use POSIX;

now times are correct ;)...

----------------------------------------------------------------------

Comment By: Patric Mueller (bhaak)
Date: 2011-03-28 12:40

Message:
A workaround I'm using is using
my constant $TZ = strftime("%z",localtime);

This returns the current time zone offset.

This isn't a real solution as the dates after the change of the daylight
saving time are still wrong if they come from a run of the program before
the change of the daylight saving time.

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=424135&aid=3098768&group_id=39046
SourceForge.net
2012-05-01 14:11:56 UTC
Permalink
Bugs item #3098768, was opened at 2010-10-30 02:27
Message generated for change (Comment added) made by betlit
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=424135&aid=3098768&group_id=39046

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: tv_grab_ch_search
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Patric Mueller (bhaak)
Assigned to: Daniel Bittel (betlit)
Summary: _ch_search: not honoring daylight saving time

Initial Comment:
The current CVS version of tv_grab_ch_search has the CET timezone hardcoded:
tv_grab_ch_search.in:148 ## the timezone tv.search.ch lives in is, CET/CEST
tv_grab_ch_search.in:149: my constant $TZ = "+0100";

For the time being this problem will of course resolve itself tonight. :)

----------------------------------------------------------------------
Post by SourceForge.net
Comment By: Daniel Bittel (betlit)
Date: 2012-05-01 07:11

Message:
oh bugger... ok, i'll look into it.

----------------------------------------------------------------------

Comment By: Karl Dietz (dekarl)
Date: 2012-04-30 03:24

Message:
A fix has been commited by betlit.
But now there seems to be some issue/overlap with the exported data, see
the delta at
http://www.crustynet.org.uk/~xmltv-tester/squeeze/nightly/0/result.html#tv_grab_ch_search


----------------------------------------------------------------------

Comment By: Daniel Bittel (betlit)
Date: 2012-04-24 12:11

Message:
finally go this fixed by switching from Date::Manip to DateTime which
handles the DST much nicer (thanks to dekarl for the hint).

----------------------------------------------------------------------

Comment By: Karl Dietz (dekarl)
Date: 2011-03-30 01:48

Message:
Hi Thomi,

here it the code from _pt_meo
use the module
102: use DateTime;

get the time from the data
206: my $starttime = $xpc->findvalue( 'EPG:StartTime', $inprog );
convert text into timestamp
207: my $dtstart = dt_from_string( $starttime );
add timestmap to programme, using XMLTV format (%z is +0100 or +0200
depending on the timestamp)
208: $prog{start} = $dtstart->strftime( '%Y%m%d%H%M%S %z' );

that's the function that converts the time
272: sub dt_from_string
273: {
store parameters into $string, you might want to keep date and time
seperate and use ( $date, $time ) to have two parameters
274: my( $string ) = @_;
split $string into parts of the timestamp source has "YYYY-MM-DD HH:MM:SS"
format. If you keep date/time seperate you can just copy these lines and
split date/time in two steps
275: my($year, $month, $day, $hour, $minute, $second) =
276: ($string =~ m|(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})|);
create timestamp from values
277: my $dt = DateTime->new( year => $year,
278: month => $month,
279: day => $day,
280: hour => $hour,
281: minute => $minute,
if you don't have seconds you can just drop that line
282: second => $second,
the timestamp is in localtime as appropriate for Portugal, Europe/Zurich
would be used for Switzerland
283: time_zone => 'Europe/Lisbon',
284: );
285: return $dt;
286: }



the part in _ch_search is this:
mix $grabDate and the time
409: my $tmp = substr($grabDate,0,4) . substr($grabDate,4,2) .
substr($grabDate,6,2) .(($tv_show->look_down('_tag',
'td'))[0])->as_text();
drop : from the time
410: $tmp =~ s/://;
append fixed time offset
411: my $start = "$tmp"."00 $TZ";
store the start time in the programme
412: $show{start} = $start;


Regards,
Karl

----------------------------------------------------------------------

Comment By: Karl Dietz (dekarl)
Date: 2011-03-30 01:11

Message:
great that you found a workaround that is working for now!
But that fix will break the schedule when you grab for days that are on the
other side of the DST switch.

Can you take a look at _pt_meo? It is converting floating localtime into
specific localtime, too. (and really simple, that's why I'm suggesting it)
That would solve all issues but one. That being invalid localtime in the
guide, like 02:30 when the clock jumps from 01:59 to 03:00.

Regards,
Karl

----------------------------------------------------------------------

Comment By: thomi_ch (thomi_ch)
Date: 2011-03-29 04:52

Message:
hey patric

thanks for your solution/workaround.. fixed it like this.. and also added
this line after #!/usr/bin/perl

use POSIX;

now times are correct ;)...

----------------------------------------------------------------------

Comment By: Patric Mueller (bhaak)
Date: 2011-03-28 12:40

Message:
A workaround I'm using is using
my constant $TZ = strftime("%z",localtime);

This returns the current time zone offset.

This isn't a real solution as the dates after the change of the daylight
saving time are still wrong if they come from a run of the program before
the change of the daylight saving time.

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=424135&aid=3098768&group_id=39046
SourceForge.net
2012-05-01 16:22:25 UTC
Permalink
Bugs item #3098768, was opened at 2010-10-30 02:27
Message generated for change (Comment added) made by betlit
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=424135&aid=3098768&group_id=39046

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: tv_grab_ch_search
Group: None
Status: Closed
Resolution: None
Priority: 5
Private: No
Submitted By: Patric Mueller (bhaak)
Assigned to: Daniel Bittel (betlit)
Summary: _ch_search: not honoring daylight saving time

Initial Comment:
The current CVS version of tv_grab_ch_search has the CET timezone hardcoded:
tv_grab_ch_search.in:148 ## the timezone tv.search.ch lives in is, CET/CEST
tv_grab_ch_search.in:149: my constant $TZ = "+0100";

For the time being this problem will of course resolve itself tonight. :)

----------------------------------------------------------------------
Comment By: Daniel Bittel (betlit)
Date: 2012-05-01 09:22

Message:
duh! i screwed up the --days and --offset calc causing the grabber to
always stop after one day.

it's fixed now and the grabber passes all tests again.

----------------------------------------------------------------------

Comment By: Daniel Bittel (betlit)
Date: 2012-05-01 07:11

Message:
oh bugger... ok, i'll look into it.

----------------------------------------------------------------------

Comment By: Karl Dietz (dekarl)
Date: 2012-04-30 03:24

Message:
A fix has been commited by betlit.
But now there seems to be some issue/overlap with the exported data, see
the delta at
http://www.crustynet.org.uk/~xmltv-tester/squeeze/nightly/0/result.html#tv_grab_ch_search


----------------------------------------------------------------------

Comment By: Daniel Bittel (betlit)
Date: 2012-04-24 12:11

Message:
finally go this fixed by switching from Date::Manip to DateTime which
handles the DST much nicer (thanks to dekarl for the hint).

----------------------------------------------------------------------

Comment By: Karl Dietz (dekarl)
Date: 2011-03-30 01:48

Message:
Hi Thomi,

here it the code from _pt_meo
use the module
102: use DateTime;

get the time from the data
206: my $starttime = $xpc->findvalue( 'EPG:StartTime', $inprog );
convert text into timestamp
207: my $dtstart = dt_from_string( $starttime );
add timestmap to programme, using XMLTV format (%z is +0100 or +0200
depending on the timestamp)
208: $prog{start} = $dtstart->strftime( '%Y%m%d%H%M%S %z' );

that's the function that converts the time
272: sub dt_from_string
273: {
store parameters into $string, you might want to keep date and time
seperate and use ( $date, $time ) to have two parameters
274: my( $string ) = @_;
split $string into parts of the timestamp source has "YYYY-MM-DD HH:MM:SS"
format. If you keep date/time seperate you can just copy these lines and
split date/time in two steps
275: my($year, $month, $day, $hour, $minute, $second) =
276: ($string =~ m|(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})|);
create timestamp from values
277: my $dt = DateTime->new( year => $year,
278: month => $month,
279: day => $day,
280: hour => $hour,
281: minute => $minute,
if you don't have seconds you can just drop that line
282: second => $second,
the timestamp is in localtime as appropriate for Portugal, Europe/Zurich
would be used for Switzerland
283: time_zone => 'Europe/Lisbon',
284: );
285: return $dt;
286: }



the part in _ch_search is this:
mix $grabDate and the time
409: my $tmp = substr($grabDate,0,4) . substr($grabDate,4,2) .
substr($grabDate,6,2) .(($tv_show->look_down('_tag',
'td'))[0])->as_text();
drop : from the time
410: $tmp =~ s/://;
append fixed time offset
411: my $start = "$tmp"."00 $TZ";
store the start time in the programme
412: $show{start} = $start;


Regards,
Karl

----------------------------------------------------------------------

Comment By: Karl Dietz (dekarl)
Date: 2011-03-30 01:11

Message:
great that you found a workaround that is working for now!
But that fix will break the schedule when you grab for days that are on the
other side of the DST switch.

Can you take a look at _pt_meo? It is converting floating localtime into
specific localtime, too. (and really simple, that's why I'm suggesting it)
That would solve all issues but one. That being invalid localtime in the
guide, like 02:30 when the clock jumps from 01:59 to 03:00.

Regards,
Karl

----------------------------------------------------------------------

Comment By: thomi_ch (thomi_ch)
Date: 2011-03-29 04:52

Message:
hey patric

thanks for your solution/workaround.. fixed it like this.. and also added
this line after #!/usr/bin/perl

use POSIX;

now times are correct ;)...

----------------------------------------------------------------------

Comment By: Patric Mueller (bhaak)
Date: 2011-03-28 12:40

Message:
A workaround I'm using is using
my constant $TZ = strftime("%z",localtime);

This returns the current time zone offset.

This isn't a real solution as the dates after the change of the daylight
saving time are still wrong if they come from a run of the program before
the change of the daylight saving time.

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=424135&aid=3098768&group_id=39046
SourceForge.net
2012-05-02 08:46:46 UTC
Permalink
Bugs item #3098768, was opened at 2010-10-30 02:27
Message generated for change (Settings changed) made by dekarl
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=424135&aid=3098768&group_id=39046

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: tv_grab_ch_search
Group: None
Status: Closed
Resolution: Fixed
Priority: 5
Private: No
Submitted By: Patric Mueller (bhaak)
Assigned to: Daniel Bittel (betlit)
Summary: _ch_search: not honoring daylight saving time

Initial Comment:
The current CVS version of tv_grab_ch_search has the CET timezone hardcoded:
tv_grab_ch_search.in:148 ## the timezone tv.search.ch lives in is, CET/CEST
tv_grab_ch_search.in:149: my constant $TZ = "+0100";

For the time being this problem will of course resolve itself tonight. :)

----------------------------------------------------------------------

Comment By: Daniel Bittel (betlit)
Date: 2012-05-01 09:22

Message:
duh! i screwed up the --days and --offset calc causing the grabber to
always stop after one day.

it's fixed now and the grabber passes all tests again.

----------------------------------------------------------------------

Comment By: Daniel Bittel (betlit)
Date: 2012-05-01 07:11

Message:
oh bugger... ok, i'll look into it.

----------------------------------------------------------------------

Comment By: Karl Dietz (dekarl)
Date: 2012-04-30 03:24

Message:
A fix has been commited by betlit.
But now there seems to be some issue/overlap with the exported data, see
the delta at
http://www.crustynet.org.uk/~xmltv-tester/squeeze/nightly/0/result.html#tv_grab_ch_search


----------------------------------------------------------------------

Comment By: Daniel Bittel (betlit)
Date: 2012-04-24 12:11

Message:
finally go this fixed by switching from Date::Manip to DateTime which
handles the DST much nicer (thanks to dekarl for the hint).

----------------------------------------------------------------------

Comment By: Karl Dietz (dekarl)
Date: 2011-03-30 01:48

Message:
Hi Thomi,

here it the code from _pt_meo
use the module
102: use DateTime;

get the time from the data
206: my $starttime = $xpc->findvalue( 'EPG:StartTime', $inprog );
convert text into timestamp
207: my $dtstart = dt_from_string( $starttime );
add timestmap to programme, using XMLTV format (%z is +0100 or +0200
depending on the timestamp)
208: $prog{start} = $dtstart->strftime( '%Y%m%d%H%M%S %z' );

that's the function that converts the time
272: sub dt_from_string
273: {
store parameters into $string, you might want to keep date and time
seperate and use ( $date, $time ) to have two parameters
274: my( $string ) = @_;
split $string into parts of the timestamp source has "YYYY-MM-DD HH:MM:SS"
format. If you keep date/time seperate you can just copy these lines and
split date/time in two steps
275: my($year, $month, $day, $hour, $minute, $second) =
276: ($string =~ m|(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})|);
create timestamp from values
277: my $dt = DateTime->new( year => $year,
278: month => $month,
279: day => $day,
280: hour => $hour,
281: minute => $minute,
if you don't have seconds you can just drop that line
282: second => $second,
the timestamp is in localtime as appropriate for Portugal, Europe/Zurich
would be used for Switzerland
283: time_zone => 'Europe/Lisbon',
284: );
285: return $dt;
286: }



the part in _ch_search is this:
mix $grabDate and the time
409: my $tmp = substr($grabDate,0,4) . substr($grabDate,4,2) .
substr($grabDate,6,2) .(($tv_show->look_down('_tag',
'td'))[0])->as_text();
drop : from the time
410: $tmp =~ s/://;
append fixed time offset
411: my $start = "$tmp"."00 $TZ";
store the start time in the programme
412: $show{start} = $start;


Regards,
Karl

----------------------------------------------------------------------

Comment By: Karl Dietz (dekarl)
Date: 2011-03-30 01:11

Message:
great that you found a workaround that is working for now!
But that fix will break the schedule when you grab for days that are on the
other side of the DST switch.

Can you take a look at _pt_meo? It is converting floating localtime into
specific localtime, too. (and really simple, that's why I'm suggesting it)
That would solve all issues but one. That being invalid localtime in the
guide, like 02:30 when the clock jumps from 01:59 to 03:00.

Regards,
Karl

----------------------------------------------------------------------

Comment By: thomi_ch (thomi_ch)
Date: 2011-03-29 04:52

Message:
hey patric

thanks for your solution/workaround.. fixed it like this.. and also added
this line after #!/usr/bin/perl

use POSIX;

now times are correct ;)...

----------------------------------------------------------------------

Comment By: Patric Mueller (bhaak)
Date: 2011-03-28 12:40

Message:
A workaround I'm using is using
my constant $TZ = strftime("%z",localtime);

This returns the current time zone offset.

This isn't a real solution as the dates after the change of the daylight
saving time are still wrong if they come from a run of the program before
the change of the daylight saving time.

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=424135&aid=3098768&group_id=39046
Loading...