dascope has asked for the wisdom of the Perl Monks concerning the following question:

Hi! Anybody know of a module / code snippet that can help me convert the following date/time format :

Fri Jul 27 19:06:54 2001 (taken from an email header)

to a more conventional format such as :

YEAR/MM/DD HH:MM:SS?

(I realize the time is already in that format...)

Replies are listed 'Best First'.
Re: Date conversion
by da (Friar) on Aug 08, 2001 at 23:38 UTC
    Check out this node. I found it by doing a search (above) for 'date'. The node discusses modules that will do what you want, such as Date::Calc and Date::Format.

    ___ -DA > perl -MPOSIX -e'$ENV{TZ}="US/Eastern";print ctime(10**9)' Sat Sep 8 21:46:40 2001
Re: Date conversion
by scain (Curate) on Aug 08, 2001 at 23:40 UTC
    There are several Date:: modules at CPAN. Look at CPAN Search and look for Date:: . An example module that will do what you want (but is probably overkill) is Date::Calc.

    Scott