h***@gmail.com
2013-10-18 19:35:51 UTC
Don't know if you're already aware of this or not...
There's a bug in uk_rt for programmes which start in the hour of the BST->GMT switchover. The times are being calculated one-hour out.
E.g E4 on 27th
Incoming RT file =
New Girl~9/25, series 2~Eggs~~Neal Brennan~Jess Day*Zooey Deschanel|Cece*Hannah Simone|Nick Miller*Jake Johnson|Schmidt*Max Greenfield|Winston*Lamorne Morris|Melissa*Kay Cannon|Sadie*June Diane Raphael|Emma*Carla Gugino~false~false~true~true~false~false~false~false~~~Sitcom~Jess and Cece panic [...] starring Zooey Deschanel.~false~27/10/2013~00:40~01:10~30
New Girl~10/25, series 2~Bathtub~~~Jess Day*Zooey Deschanel|Winston*Lamorne Morris|Schmidt*Max Greenfield|Cece*Hannah Simone|Nick Miller*Jake Johnson~false~false~true~true~false~false~false~false~~~Sitcom~Jess is desperate [...] starring Zooey Deschanel.~false~27/10/2013~01:10~01:40~30
Suburgatory~15/22, series 2~Leaving Chatswin~~~George Altman*Jeremy Sisto|Tessa Altman*Jane Levy|Ryan Shay*Parker Young|Noah Werner*Alan Tudyk~false~false~true~true~false~false~false~false~~~Sitcom~George and Noah are left [...] starring Jeremy Sisto, Jane Levy and Parker Young.~false~27/10/2013~01:40~01:05~25
The Cleveland Show~18/23, series 4~Squirt's Honour~~~Cleveland Brown/Rallo Tubbs*Mike Henry|Donna Tubbs*Sanaa Lathan|Cleveland Brown Jr*Kevin Michael Richardson~false~false~true~true~false~false~false~false~~~Sitcom~Rallo joins the Freedom Squirts, [...] to their room.~false~27/10/2013~01:05~01:25~20
i.e. programmes are
New Girl / Eggs 00:40 BST - 01:10 BST
New Girl / Bathtub 01:10 BST - 01:40 BST
Suburgatory 01:40 BST - 01:05 GMT
The Cleveland Show 01:05 GMT - 01:25 GMT
But when parsed by uk_rt this is creating:
Processing programme title 'New Girl'
Episode number/total found: episode 9 of 25 (subtitle: x/y, series z)
Series number found: series 2 (subtitle: x/y, series z)
Pre- processing title/episode details 'New Girl / Eggs'
Post-processing title/episode details 'New Girl / Eggs'
Start time given as '2013/10/27 00:40', duration 30 mins
20131027004000 +0100 - Start time
20131027011000 +0100 - Stop time
----
Processing programme title 'New Girl'
Episode number/total found: episode 10 of 25 (subtitle: x/y, series z)
Series number found: series 2 (subtitle: x/y, series z)
Pre- processing title/episode details 'New Girl / Bathtub'
Post-processing title/episode details 'New Girl / Bathtub'
Start time given as '2013/10/27 01:10', duration 30 mins
20131027011000 +0000 - Start time
20131027014000 +0000 - Stop time
----
Processing programme title 'Suburgatory'
Episode number/total found: episode 15 of 22 (subtitle: x/y, series z)
Series number found: series 2 (subtitle: x/y, series z)
Pre- processing title/episode details 'Suburgatory / Leaving Chatswin'
Post-processing title/episode details 'Suburgatory / Leaving Chatswin'
Start time given as '2013/10/27 01:40', duration 25 mins
20131027014000 +0000 - Start time
20131027020500 +0000 - Stop time
----
Processing programme title 'The Cleveland Show'
Episode number/total found: episode 18 of 23 (subtitle: x/y, series z)
Series number found: series 4 (subtitle: x/y, series z)
Pre- processing title/episode details 'The Cleveland Show / Squirt's Honour'
Post-processing title/episode details 'The Cleveland Show / Squirt's Honour'
Start time given as '2013/10/27 01:05', duration 20 mins
20131027010500 +0000 - Start time
20131027012500 +0000 - Stop time
----
i.e.
New Girl / Eggs 00:40 BST - 01:10 BST
New Girl / Bathtub 01:10 GMT - 01:40 GMT
Suburgatory 01:40 GMT - 02:05 GMT
The Cleveland Show 01:05 GMT - 01:25 GMT
You can see the start & stop times of Bathtub and Suburgatory are wrong.
The problem is caused by lines 2756~
# Determine start time with correct UTC offset
my $start_dt = DateTime->new(
...
This is generating a time in *UTC*. Here's the reason:
http://search.cpan.org/~drolsky/DateTime-1.03/lib/DateTime.pm#Ambiguous_Local_Times
----
Ambiguous Local Times
Because of Daylight Saving Time, it is possible to specify a local time that is ambiguous. For example, in the US in 2003, the transition from to saving to standard time occurred on October 26, at 02:00:00 local time. The local clock changed from 01:59:59 (saving time) to 01:00:00 (standard time). This means that the hour from 01:00:00 through 01:59:59 actually occurs twice, though the UTC time continues to move forward.
If you specify an ambiguous time, then the latest UTC time is always used, in effect always choosing standard time.
----
Since you have not specified a UTC offset to DateTime->new() it is using an offset of 0. (i.e. Setting the TZ to Europe/London is not sufficient to determine BST or GMT - so it becomes an "ambiguous time"). You are then picking this up thinking this is the offset of the yyyymmdd hh:mm:ss you have given it, which of course it's not.
Cheers,
Geoff
There's a bug in uk_rt for programmes which start in the hour of the BST->GMT switchover. The times are being calculated one-hour out.
E.g E4 on 27th
Incoming RT file =
New Girl~9/25, series 2~Eggs~~Neal Brennan~Jess Day*Zooey Deschanel|Cece*Hannah Simone|Nick Miller*Jake Johnson|Schmidt*Max Greenfield|Winston*Lamorne Morris|Melissa*Kay Cannon|Sadie*June Diane Raphael|Emma*Carla Gugino~false~false~true~true~false~false~false~false~~~Sitcom~Jess and Cece panic [...] starring Zooey Deschanel.~false~27/10/2013~00:40~01:10~30
New Girl~10/25, series 2~Bathtub~~~Jess Day*Zooey Deschanel|Winston*Lamorne Morris|Schmidt*Max Greenfield|Cece*Hannah Simone|Nick Miller*Jake Johnson~false~false~true~true~false~false~false~false~~~Sitcom~Jess is desperate [...] starring Zooey Deschanel.~false~27/10/2013~01:10~01:40~30
Suburgatory~15/22, series 2~Leaving Chatswin~~~George Altman*Jeremy Sisto|Tessa Altman*Jane Levy|Ryan Shay*Parker Young|Noah Werner*Alan Tudyk~false~false~true~true~false~false~false~false~~~Sitcom~George and Noah are left [...] starring Jeremy Sisto, Jane Levy and Parker Young.~false~27/10/2013~01:40~01:05~25
The Cleveland Show~18/23, series 4~Squirt's Honour~~~Cleveland Brown/Rallo Tubbs*Mike Henry|Donna Tubbs*Sanaa Lathan|Cleveland Brown Jr*Kevin Michael Richardson~false~false~true~true~false~false~false~false~~~Sitcom~Rallo joins the Freedom Squirts, [...] to their room.~false~27/10/2013~01:05~01:25~20
i.e. programmes are
New Girl / Eggs 00:40 BST - 01:10 BST
New Girl / Bathtub 01:10 BST - 01:40 BST
Suburgatory 01:40 BST - 01:05 GMT
The Cleveland Show 01:05 GMT - 01:25 GMT
But when parsed by uk_rt this is creating:
Processing programme title 'New Girl'
Episode number/total found: episode 9 of 25 (subtitle: x/y, series z)
Series number found: series 2 (subtitle: x/y, series z)
Pre- processing title/episode details 'New Girl / Eggs'
Post-processing title/episode details 'New Girl / Eggs'
Start time given as '2013/10/27 00:40', duration 30 mins
20131027004000 +0100 - Start time
20131027011000 +0100 - Stop time
----
Processing programme title 'New Girl'
Episode number/total found: episode 10 of 25 (subtitle: x/y, series z)
Series number found: series 2 (subtitle: x/y, series z)
Pre- processing title/episode details 'New Girl / Bathtub'
Post-processing title/episode details 'New Girl / Bathtub'
Start time given as '2013/10/27 01:10', duration 30 mins
20131027011000 +0000 - Start time
20131027014000 +0000 - Stop time
----
Processing programme title 'Suburgatory'
Episode number/total found: episode 15 of 22 (subtitle: x/y, series z)
Series number found: series 2 (subtitle: x/y, series z)
Pre- processing title/episode details 'Suburgatory / Leaving Chatswin'
Post-processing title/episode details 'Suburgatory / Leaving Chatswin'
Start time given as '2013/10/27 01:40', duration 25 mins
20131027014000 +0000 - Start time
20131027020500 +0000 - Stop time
----
Processing programme title 'The Cleveland Show'
Episode number/total found: episode 18 of 23 (subtitle: x/y, series z)
Series number found: series 4 (subtitle: x/y, series z)
Pre- processing title/episode details 'The Cleveland Show / Squirt's Honour'
Post-processing title/episode details 'The Cleveland Show / Squirt's Honour'
Start time given as '2013/10/27 01:05', duration 20 mins
20131027010500 +0000 - Start time
20131027012500 +0000 - Stop time
----
i.e.
New Girl / Eggs 00:40 BST - 01:10 BST
New Girl / Bathtub 01:10 GMT - 01:40 GMT
Suburgatory 01:40 GMT - 02:05 GMT
The Cleveland Show 01:05 GMT - 01:25 GMT
You can see the start & stop times of Bathtub and Suburgatory are wrong.
The problem is caused by lines 2756~
# Determine start time with correct UTC offset
my $start_dt = DateTime->new(
...
This is generating a time in *UTC*. Here's the reason:
http://search.cpan.org/~drolsky/DateTime-1.03/lib/DateTime.pm#Ambiguous_Local_Times
----
Ambiguous Local Times
Because of Daylight Saving Time, it is possible to specify a local time that is ambiguous. For example, in the US in 2003, the transition from to saving to standard time occurred on October 26, at 02:00:00 local time. The local clock changed from 01:59:59 (saving time) to 01:00:00 (standard time). This means that the hour from 01:00:00 through 01:59:59 actually occurs twice, though the UTC time continues to move forward.
If you specify an ambiguous time, then the latest UTC time is always used, in effect always choosing standard time.
----
Since you have not specified a UTC offset to DateTime->new() it is using an offset of 0. (i.e. Setting the TZ to Europe/London is not sufficient to determine BST or GMT - so it becomes an "ambiguous time"). You are then picking this up thinking this is the offset of the yyyymmdd hh:mm:ss you have given it, which of course it's not.
Cheers,
Geoff