If your going to have Perl do it instead of the database I would use Time::CTime
and Time::ParseDate.  They work very well.  If you need more powerful parsing
Date::Manip is where its at.  If performance is an issue use Date::Manip as a
last result.  It is very robust, but that robustness comes with a performance
penalty.

On the database side of things you should find the appropriate function.  For
example, Oracle's would be to_char.

-Ian

Jeff Urlwin wrote:
> 
> > 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.
> >
> 
> Or Date::Manip
> 
> Jeff

Reply via email to