Fussy Date::Parse...

Discussion in 'Perl Misc' started by DJ Stunks, Feb 27, 2007.

  1. DJ Stunks

    DJ Stunks Guest

    All,

    I love Date::parse but it's struggling parsing what I consider to be a
    pretty unambiguous date time that Date::Manip handles just fine...

    C:\>perl -MDate::parse \
    -e "print str2time('2/26/2007 14:38:13 PM') ? 'y' : 'n'"
    n

    C:\>perl -MDate::Manip \
    -e "print UnixDate('2/26/2007 14:38:13 PM','%s') ? 'y' : 'n'"
    y

    C:\>perl -MDate::Manip \
    -e "print UnixDate('2/26/2007 14:38:13 PM','%m/%d/%Y %T')"
    02/26/2007 14:38:13

    I don't really have a question because Date::Manip is ok, but I needed
    epoch time.

    -jp
     
    DJ Stunks, Feb 27, 2007
    #1
    1. Advertising

  2. DJ Stunks wrote:
    > I love Date::parse but it's struggling parsing what I consider to be a
    > pretty unambiguous date time that Date::Manip handles just fine...
    >
    > C:\>perl -MDate::parse \
    > -e "print str2time('2/26/2007 14:38:13 PM') ? 'y' : 'n'"

    --------------------------------^^-------^^

    Shouldn't that be 2:38:13 PM or just 14:38:13?

    To it seems like Date::parse is doing the right thing, unlike Date::Manip.

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Feb 27, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    1
    Views:
    606
    Matthew Speed
    Nov 8, 2003
  2. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,276
    Michael Borgwardt
    May 30, 2004
  3. Matt
    Replies:
    2
    Views:
    519
    Pete Becker
    Nov 8, 2003
  4. Jacob Gorban
    Replies:
    12
    Views:
    244
    Reid Thompson
    Nov 2, 2009
  5. Matteo
    Replies:
    4
    Views:
    156
    Dr John Stockton
    Jun 15, 2004
Loading...

Share This Page