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

Hi, I have a a input string format 5May10-10am. i need to convert to to seconds how could parse this to convert into seconds?

Replies are listed 'Best First'.
Re: time in to sec calculation
by ww (Archbishop) on May 31, 2010 at 12:50 UTC

    Seconds since when?

    You need some sort of base- (or zero-) time to convert a date to anything meaningful.

    Choices include (among others):

    • Epoch time (specify whose epoch AND a Time Zone)
    • Your birth date and time (adjust for TZ, as necessary)
    • Adoption of the Gregorian calendar
    • Astronomical convention (Julian Day Zero, hrs zero....)
    • 4004 BC

    Please rethink your question.

Re: time in to sec calculation
by Anonymous Monk on May 31, 2010 at 12:17 UTC