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: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: dbd::sybase datetime format
Date: Apr 1 2002 8:10PM

Stephen.Sprague@morganstanley.com writes:
 > 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!

Yikes!

I'll try to code it and see what happens with those dates :-)

(though it'll have to wait until next week, I think - I've got some
other projects on the front-burner right now :-)

Michael


 > 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 :
 > 

-- 
Michael Peppler                              Data Migrations, Inc.
mpeppler@peppler.org           *or*          mpeppler@mbay.net
http://www.mbay.net/~mpeppler
International Sybase User Group: http://www.isug.com