sybase datetime

[prev] [thread] [next] [Date index for 2005/05/02]

From: H S
Subject: sybase datetime
Date: 19:51 on 02 May 2005
Hi,

I have trouble getting Time::Piece working with datetime field in one
of my table.  I need to get yyyymmdd hh:mm:ss.   Nonetheless,=20
Sybase's default format is  May 2 2005  8:13PM

Is there anyway to manipulate the output  or  I have to sybased
built-in function with set_sql?

__PACKAGE__->has_a(=20
        post_time  =3D> 'Time::Piece',=20
        inflate    =3D> sub{ Time::Piece->strptime(shift, "%b %d %Y %I:%M%p=
") });=20

I even get a 'parsing error'  with Time::Piece object in the above
code.  Yet it worked fine when I tried with

 my $str =3D "Apr 29 2005 12:26AM";=20
my $t =3D Time::Piece->strptime($str, "%b %d %Y %I:%M%p");=20
print $t->strftime("%Y%m%d %r");=20

Thank you,
Isarin

sybase datetime
H S 19:51 on 02 May 2005

Generated at 11:49 on 06 May 2005 by mariachi v0.52