in reply to Re^4: Ovid's "Please Stop Using Perl 3" (Date::Manip)
in thread Ovid's "Please Stop Using Perl 3"

How do you parse date/time strings?

I don't parse dates in unknown formats. Most date strings I deal with can be parsed with /(\d\d)/g, as it should be. On rare occasions I've worked with worse formats but the worst case was just building a simple hash of month abbreviations.

When I do parse date strings, I usually parse one per line for tons of lines and so "slow" adds up quickly and so I probably wouldn't use Date::Manip.

Thanks for pointing out how much else Date::Manip does well.

- tye        

  • Comment on Re^5: Ovid's "Please Stop Using Perl 3" (Date::Manip)

Replies are listed 'Best First'.
Re^6: Ovid's "Please Stop Using Perl 3" (Date::Manip)
by nevyn (Monk) on Sep 07, 2006 at 20:29 UTC
    I don't parse dates in unknown formats.

    Right, I guess I've probably done an above average number of scripts which do reports and take date arguments. A problem which ParseDate was basically written to solve.

    And thinking about it more, I have written a couple of things like my "And-httpd syslog" => "Apache-httpd combined log" converter, which are basically regexps + hash and they would be more painful to do with Date::Manip (and speed does matter). But implementing the "skip enteries before time X" option, without it, would be bad :).

    --
    And-httpd, $2,000 security guarantee
    James Antill