develooper Front page | perl.datetime | Postings from July 2003

DateTime::Format::Pg problem

Thread Next
From:
Alex Boster
Date:
July 15, 2003 12:30
Subject:
DateTime::Format::Pg problem
Message ID:
1058297439.30685.10.camel@dev.archnet2.atgsd.com
DateTime::Format::Pg dies when I parse an ISO date.  Can anyone point me
in the right direction?  I looked at the module's code, and I can't find
the problem.  The regex should match and fractional_seconds is in fact
on the params list.

[aboster@data aboster]$ cat dt_test.pl
#!/usr/local/bin/perl -w
                                                                                
use DateTime;
use DateTime::Format::Pg;
use strict;
                                                                                
my $str = '2003-07-14 09:37:33-07';
my $d = DateTime::Format::Pg->parse_datetime($str);
print Dumper(\$d);
                                                                                
[aboster@data aboster]$ ./dt_test.pl
The following parameter was passed in the call to DateTime::new but was
not listed in the validation options: fractional_second
 at
/usr/local/lib/perl5/site_perl/5.8.0/DateTime/Format/Builder/Parser/Regex.pm line 135
[aboster@data aboster]$

Since there are warnings in the docs about setting a timezone, I have
also tried instantiating the a DateTime::Format::Pg object with the
server_tz set and then calling the parse_timestamptz function.  The
behavior is the same. (No surprise as this is the first parser tried by
the more general function above.)

This is DateTime::Format::Pg version 0.04.

Thanks in advance,
Alex

PS: Here's hoping I haven't missed something really obvious and am
making a public spectacle of it...


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About