PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Stephen dot Sprague at morganstanley dot com
Subject: Re: dbd::sybase datetime format
Date: Apr 1 2002 7:45PM

Hi Michael-
yes. for the most part.

But  speaking  of  limitations,  gads,  the  database  I'm  mining   has
"12/31/9999 00:00:00" for date/times all over the place!  So "interesting"
would be the key word for me!

Something to think about anyway.

Thanks,
Steve




On Mon, 1 Apr 2002 @ 10:55am, an entity claiming to be Michael Peppler...:

mpeppl :Stephen.Sprague@morganstanley.com writes:
mpeppl : > Hi folks-
mpeppl : >
mpeppl : > Given Sybase::DBD version 0.94 I see Michael has provided us  with  ways
mpeppl : > to  change  the  default  format  of  dates  via  the   $dbh->func($fmt,
mpeppl : > '_date_fmt') callback.
mpeppl : >
mpeppl : > Very nice.
mpeppl : >
mpeppl : > However, if none the given ones suit  me  I'm  forced  to  go  thru  the
mpeppl : > statement handle's NAMES/TYPES and do a conversion  from  there  slowing
mpeppl : > down the process greatly.
mpeppl : >
mpeppl : > How picky would it be to ask for 'YYYYMMDD HH:MM:SS'? Or  better  yet  a
mpeppl : > callback whereby I could contruct the date myself if sent the parts, ala
mpeppl : > perl's localtime?
mpeppl :
mpeppl :Something like strftime(), maybe?
mpeppl :
mpeppl :This could work like this:
mpeppl :
mpeppl :$dbh->{syb_date_fmt} = "%c";
mpeppl :
mpeppl :and DBD::Sybase would call strftime() on incomming
mpeppl :datetime/smalldatetime datatypes.
mpeppl :
mpeppl :Limitations are the limitations of struct tm (hence the limitations of
mpeppl :the time_t C type, currently from jan 1 1970 to some date in
mpeppl :2038). Behaviour for dates outside of that range might get
mpeppl :"interesting"...
mpeppl :
mpeppl :Michael
mpeppl :