Bill McClintock asks about different date formats,

> I need to find a way to get date fields in a database to be 
> returned in the same formatting.  I have an MSSQL database but 
> the end clients are linux w/ DBD::Sybase (FreeTDS build) and 
> WinNT w/ DBD::ODBC.
> 
> DBD::Sybase returns dates like...'Apr 15 2002 12:00AM'
> DBD::ODBC returns dates like...'2002-04-15 00:00:00.000'

Well, this is a little off topic because the different output 
formats are db config dependent in many cases.  However, I've
scratched my head over it a bunch lately and here is what I've
found.  Take a look at the HTTP::Date::str2time date string to 
time conversion subroutine and the POSIX::strftime time to string
format subroutine.  Between these two, I've been able to get most 
of my date conversions to work as I needed.  I've not tried the 
two you asked about specifically, but that's where I'd start with
the effort.

Stph

Reply via email to