Loading ...
Sorry, an error occurred while loading the content.

str2time returns bad result for timezone MST7MDT during daylight time

Expand Messages
  • Kelly Jones
    This code: perl -le use Date::Parse; for $tz ( MST , MDT , MST7MDT ) {print str2time( 04 Jul 2009 14:42:00 $tz );} returns: 1246743720 1246740120
    Message 1 of 1 , Apr 1, 2010
      This code:

      perl -le 'use Date::Parse; for $tz ("MST", "MDT", "MST7MDT") {print
      str2time("04 Jul 2009 14:42:00 $tz");}'



      In other words, str2time returns the same Unix time for
      MST and MST7MDT on July 4th.

      That's incorrect: on July 4th, MST7MDT should equal MDT, not MST.

      This isn't related to recent DST changes, since
      daylight savings time hasn't changed for July in ages.

      We're just a Bunch Of Regular Guys, a collective group that's trying
      to understand and assimilate technology. We feel that resistance to
      new ideas and technology is unwise and ultimately futile.
    Your message has been successfully submitted and would be delivered to recipients shortly.