RE: ISO8601 date formats
Michael Peppler <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.dbi.sybase |
|---|---|
| Message-ID | <[email protected]> |
On Tue, 2004-09-21 at 15:41, Avis, Ed wrote: > Michael Peppler wrote: > > >At the moment DBD::Sybase has a $dbh->func() call that you can use to > >control the date/time formating. > > >I propose to make this just a bit more sophisticated, by binding > >date/time values as a CS_DATETIME value (a struct with two 4 byte > >ints, the first for the number of days since jan 1 1900, and the > >second for the number of milliseconds since midnight). > > >If the user wants ISO8601 formats I call cs_dt_crack() to get > >something that resembles as struct tm, and then use sprintf or > >strftime() to build the char string. > > Sounds useful. I wonder whether in the longer term Sybase would add > some more standard date formats to ctlib? There's an open enhancement request on the ISUG site. If you're an ISUG member you can vote on it to give it visibility. > On the question of which ISO 8601 variant to support, the full > pedantic one with the T in the middle is something you 'should' have > (if you're going to support a standard, do it properly) but a > simpler form like 2004-09-21 14:40:00 would also be handy, if it > doesn't complicate the interface to allow both. That shouldn't be a problem, and also matches the other comment from Matthew Persico. Michael -- Michael Peppler Data Migrations, Inc. [email protected] http://www.peppler.org/ Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short or long term contract positions - http://www.peppler.org/resume.html