Date::Manip is, as far as I know, the only one that does this. I think this has come up before so you should Super Search it too. Here's a snippet I use from the command line. Read the docs to see what's going on.

use Date::Manip; my $str_date = shift || die "give a date!\n"; # almost *any* format $str_date = $str_date =~ /^(?!19|20)\d{7,10}$/ ? ParseDateString("epoch $str_date") : $str_date; print UnixDate( ParseDate( $str_date ), "\t%D %X, %A\n");

It gets all your examples but one.

jinx@jasper[38]~/bin>dater "22 Oct, 15:30" 10/22/04 15:30:00, Friday jinx@jasper[39]~/bin>dater "noon tomorrow" 10/22/04 12:00:00, Friday jinx@jasper[40]~/bin>dater "this afternoon at 3" jinx@jasper[41]~/bin>dater "this afternoon" jinx@jasper[42]~/bin>dater "this afternoon at 3" jinx@jasper[43]~/bin>dater "today at 3" jinx@jasper[44]~/bin>dater "today at 3pm" 10/21/04 15:00:00, Thursday jinx@jasper[45]~/bin>dater "10am next tuesday" 10/26/04 10:00:00, Tuesday

In reply to Re: Extracting time/date from english text by Your Mother
in thread Extracting time/date from english text by fce2

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.