Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: "Sabherwal, Balvinder (MBS)" <Balvinder dot Sabherwal at mortgagefamily dot com>
Subject: RE: datetime values
Date: Jan 30 2003 12:50PM

I tried using  "$dbh->cs_dt_info(CS_SET, CS_DT_CONVFMT, CS_UNUSED,
CS_DATES_LONG );" and now I get the error as below.

Usage: Sybase::CTlib::cs_dt_info(action, type, item, buffer) at C:\tmp\
line 13.

I tried changing it to "$dbh->cs_dt_info(CS_SET, CS_DT_CONVFMT,
CS_DATES_LONG , CS_UNUSED);" assuming that item and buffer are in the wrong
place in the statement. that also did not helped.

I'm not using any convert to get the values from the table. The column type
is datetime and I'm selecting it as is.


-----Original Message-----
From: Scott Zetlan []
Sent: Wednesday, January 29, 2003 5:38 PM
To: SybPerl Discussion List
Subject: RE: datetime values

Also consider just using smalldatetime (stores dates down to the minute)
instead of datetime -- rarely does anyone really need that kind of
resolution on a time stamp.

> -----Original Message-----
> From:
> []On Behalf Of Michael Peppler
> Sent: Wednesday, January 29, 2003 5:23 PM
> To: SybPerl Discussion List
> Subject: Re: datetime values
> On Wed, 2003-01-29 at 13:13, Sabherwal, Balvinder (MBS) wrote:
> > List,
> >
> > I am selecting a datetime type column from the database table
> and while I'm
> > losing the second and ms second value from it. Can anyone show
> me how can I
> > preserve the second and ms as well in my select.
> > i.e. if I select the value in dbartisan it shows me as "1/29/03
> 3:03:13.847
> > PM" but if I select and print the same column from the perl
> scrip, it shows
> > me only "1/29/03 3:03PM"
> You can use cs_dt_info(CS_SET, CS_DT_CONVFMT, CS_UNUSED, CS_DATES_LONG)
> to get the full date (including milliseconds).
> Michael
> > --
> > Michael Peppler                              Data Migrations, Inc.
> >       
> > Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available
> for short or
> > long term contract positions -