[Catalyst] Re: DateTime::Format::MySQL
Meeko
meeko.lists at gmail.com
Thu Dec 30 02:22:45 GMT 2010
Nevermind, I fixed my own problem. It was a stupid mistake on my part (they
usually are)
My problem was actually further down in my code. After getting my
$formatted_date object from DateTime::Format::MySQL, I was mistakenly trying
to create a new DateTime object with it, not realizing that $formatted_date
is already the DateTime object that I needed. After taking that out, and
using $formatted_date like I should have to begin with, its working now.
- Meeko
On Wed, Dec 29, 2010 at 7:10 PM, Meeko <meeko.lists at gmail.com> wrote:
> I'm having a problem with DateTime::Format::MySQL, and was wondering if
> anyone could help. I have timestamps stored in a MySQL database, and am
> trying to use this module to create a DateTime object with them.
>
> According to the module documentation, the usage is:
>
> use DateTime::Format::MySQL;
>
> my $dt =3D DateTime::Format::MySQL->parse_datetime( '2003-01-16 23:12:0=
1' );
>
> # 2003-01-16 23:12:01
> DateTime::Format::MySQL->format_datetime($dt);
>
>
> In my code, I have a variable called $ts, which I have verified matches t=
he
> proper format by displaying it to the screen, like this:
>
> $ts contains: 2010-12-28 21:45:29
>
>
> However, when I add in the following code:
>
> my $formatted_date =3D DateTime::Format::MySQL->parse_datetime($ts);
>
> I get the following error:
>
> Caught exception in MyApp::Controller::Root->index "The following paramet=
er was passed in the call to DateTime::new but was not listed in the valida=
tion options: local_rd_secs
>
>
> I have tried googling for this error, but can't seem to find the answer.
> Can anyone provide me with any insight as to what this error means?
> Thanks!
>
> - Meeko
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20101229/7073c=
ea2/attachment.htm
More information about the Catalyst
mailing list