I have two date/time strings that I need to compare to see if they are the same date or not. One is "Fri, 26 Aug 2011 14:34:55 GMT" and the other is "Sat, 27 Aug 2011 07:03:02 +1000".

I guess it's a two-step process:
1) Convert them both to the same timezone, and then
2) Compare the date component of the date/time to see if they're the same date.

I've been searching around and am now totally bewildered and baffled by the various date & time modules available. I have tried a few and can't work out how to do this. I'm not a perl programmer, I'm an occasional dabbler, but I would have thought it would be simple. Can anyone provide a straightforward way of doing this?


In reply to How to compare date/times in different timezones? by philled

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.