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

Re: DateTime::Format::Pg problem

Thread Previous
From:
Ben Bennett
Date:
July 15, 2003 12:39
Subject:
Re: DateTime::Format::Pg problem
Message ID:
20030715193834.GB24210@ayup.limey.net
fractional_seconds is deprecated...  nanoseconds have to be specified
separately.

I dunno if Pg has been updated to use the new interface yet.

		      -ben

On Tue, Jul 15, 2003 at 12:30:39PM -0700, Alex Boster wrote:
> 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 Previous


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