Re: UK RT grabber still an hour out for me

Neil Bird <[email protected]>
Newsgroups gmane.comp.tv.xmltv.general
Message-ID <[email protected]>
Around about 28/04/11 10:53, Nick Morrott typed ...
> My MythTV master backend (untouched since installation) is running
> Perl 5.8.6 and Date::Manip 5.44 on an old Fedora release. I don't see
> any problems using the current XMLTV release.

   I have:

perl-XMLTV-0.5.59-84.el5.noarch.rpm
perl-5.8.8-32.el5_5.2.i386.rpm
perl-Date-Manip-6.14-0_15.el5.noarch.rpm


   Could you please run my test script on your old Fedora box?  I'll 
re-attach it (same as previous post).  It gives me (well, gave me, I've 
patched my DM5.pm now):

Perl is 5.008008, Date::Manip in use is 5.60
Input is '2011032806:00'
First utc_offset call produced '20110328060000 +0100'
   Implicit timezone calculated to be '+0100'
Date::Manip::DM5 using TZ=UTC
ParseData output: 2011033105:00:00
parse_date -> '2011032805:00:00'
parse_local_date -> '2011032805:00:00'
date_to_local -> '2011032805:00:00 +0100'
Got '20110328050000 +0100'


   The important lines are the "Input is" and the final "Got";  note it goes 
from 06:00 [implicit BST] to 05:00 +0100.

   I wonder if there's a bug that came in after DM 5.44, since I have 5.60.


> I note from a thread on the mythtv-users lists that RHEL6 (and thus
> SL6) are still using a Date::Manip 5.xx release by default - I don't
> know the reasons for not providing a 6.xx version, but one is
> available from atrpms.net (6.14 after just checking).

   I only have CentOS, not RHEL, so can't yet move to 6.

-- 
[neil@fnx ~]# rm -f .signature
[neil@fnx ~]# ls -l .signature
ls: .signature: No such file or directory
[neil@fnx ~]# exit

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd

_______________________________________________
xmltv-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xmltv-users
datemaniptest.pl (application/x-perl, 2.2 KB)
#!/usr/bin/perl

eval 'exec /usr/bin/perl  -S $0 ${1+"$@"}'
    if 0; # not running under some shell

use warnings;
use strict;
use XMLTV::ProgressBar;
use XMLTV::Memoize; XMLTV::Memoize::check_argv('get_octets');
use XMLTV::DST;
use XMLTV::Supplement qw/GetSupplement SetSupplementRoot/;
use XMLTV::Options qw/ParseOptions/;
use XMLTV::Configure::Writer;
use XMLTV::Ask;
use XMLTV::Lineup;
use File::Path;
use File::Basename;
use LWP::UserAgent;
use HTTP::Cache::Transparent;
use Encode qw/decode encode/;
use Date::Manip;
use HTML::Entities;
use IO::Scalar; # used for configuration to write channels to string

delete $Date::Manip::DM5::Cnf{"TZ"};
$Date::Manip::DM5::Cnf{"TZ"} = Date::Manip::DM5::Date_TimeZone;
#Date::Manip::Date_Init();
#Date::Manip::Date_Init("UpdateCurrTZ=1", "TZ=");
#$Date::Manip::DM5::Cnf{"ConvTZ"}="UTC";

print "Perl is $], Date::Manip in use is " . DateManipVersion(1) . "\n";

sub t($)
{
    print STDERR $_[0] . "\n";
}

my ($prog__title, $yyyy, $mm, $dd, $prog__start, $base_tz) = ('test', '2011', '03', '28', '06:00', 'UTC');

my $input = "" . $yyyy . $mm . $dd . $prog__start . "";
t("Input is '$input'");

my $prog_start = utc_offset( $input, $base_tz );
t("First utc_offset call produced '$prog_start'");
if ($prog_start !~ m/([+-]\d{4})$/) {
    t("  Bad UTC offset '" . $1 . "' detected for '" . $prog__title . "', skipping");
    exit(1);
}
my $implicit_tz = $1;
t("  Implicit timezone calculated to be '" . $implicit_tz . "'");
my $tz = $implicit_tz;


# Break down utc_offset
print 'Date::Manip::DM5 using TZ=' . $Date::Manip::DM5::Cnf{'TZ'} . "\n";
print 'ParseData output: ' . ParseDate("2011033106:00 +0100") . "\n";

my $parse_out = XMLTV::Date::parse_date("" . $yyyy . $mm . $dd . $prog__start . " " . $tz . "");
print "parse_date -> '$parse_out'\n";

my $pld_out = parse_local_date( "" . $yyyy . $mm . $dd . $prog__start . " " . $tz . "", '+0000' );
print "parse_local_date -> '$pld_out'\n";

my $dtl_out = date_to_local( $pld_out, '+0000' );
print "date_to_local -> '$dtl_out->[0] $dtl_out->[1]'\n";


# Calculate start time with correct UTC offset
$prog_start = utc_offset("" . $yyyy . $mm . $dd . $prog__start . " " . $tz . "", $base_tz);

print "Got '$prog_start'\n";
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.