in reply to Converting POSIX format date/times to epoch seconds

Use Date::Parse.
  • Comment on Re: Converting POSIX format date/times to epoch seconds

Replies are listed 'Best First'.
Re^2: Converting POSIX format date/times to epoch seconds
by Anonymous Monk on Feb 23, 2005 at 05:16 UTC
    I'm not sure how that helps me. Say I have a date - 02/01/2005. Is that the 2nd Jan or the 1st Feb? If I know the POSIX format then I know which assumption to make. As far as I can tell, Date::Parse makes assumptions on the Time Zone, but with an internet app, my users are distributed. It looks like DateTime does the trick, but alas, there is no Windows ppm, and I had trouible building it from source. (No the app is not on Windows, but development is...)
      ...but alas, there is no Windows ppm, and I had trouible building it from source.
      Date::Parse is a member of the TimeDate-distribution, as you can see here.
      There are ppms for TimeDate available at the ActiveState-repositories.

      You can take that as a general rule. If you cannot find a module vie ppm, search at CPAN to see if it is hidden in a distribution, then use ppm to search for that distribution.


      holli, /regexed monk/

      If the only problem is telling apart day-of-month from month, just parse it, format it with strftime, and see if it matches what you started off with. If it's wrong, swith the day-of-month and month and try again.

      Kinda hackish, but seems like it would work. AFAIK, your only other option is to implement the opposite of strftime, which sounds like a lot of work.