Re: Module To Parse Format 'Friday, March 13, 2009 04:20 PM EST'

[email protected] (Zefram)
Newsgroups perl.datetime
Message-ID <[email protected]>
Roderick A. Anderson wrote:
>Heretic alert.  Date::Manip has ParseDate and UnixDate

As previously discussed, Date::Manip is a pile of steaming manure.
We've run into those two functions making a right pig's ear of timezones:

$ TZ=Australia/Sydney perl -MDate::Manip=UnixDate -lwe 'print UnixDate("2009-01-01T00:00:00", "%Y-%m-%d %T %z %Z")'
2009-01-01 00:00:00 -0500 EST
$

Timezones aside, those functions are attempting to parse date strings
of unknown format, and hence have unpredictable behaviour.  A function
that knows the expected input format will do a much better job.

-zefram
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.