<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>11157</bug_id>
          
          <creation_ts>2006-10-04 12:33:51 -0700</creation_ts>
          <short_desc>REGRESSION (r16780): Date conversion to local time gets the DST flag wrong for some dates</short_desc>
          <delta_ts>2006-10-11 12:47:25 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>420+</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>LATER</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar, Regression</keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>mitz</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>kmccullough</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>54416</commentid>
    <comment_count>0</comment_count>
    <who name="">mitz</who>
    <bug_when>2006-10-04 12:33:51 -0700</bug_when>
    <thetext>See bug 5514.

The &quot;compute DST flag based on a year which starts on the same day&quot; doesn&apos;t work for all cases, so it shouldn&apos;t be used on platforms that support negative time_t, such as Mac.

To see the regression, set your computer&apos;s time zone to New Zealand and open the attached test case, which is a variation on the test from bug 5514. It&apos;s weird that the original test didn&apos;t regress. It might point to a bug in the new implementation of the hack.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54417</commentid>
    <comment_count>1</comment_count>
      <attachid>10911</attachid>
    <who name="">mitz</who>
    <bug_when>2006-10-04 12:34:21 -0700</bug_when>
    <thetext>Created attachment 10911
Test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54494</commentid>
    <comment_count>2</comment_count>
    <who name="Kevin McCullough">kmccullough</who>
    <bug_when>2006-10-05 10:16:21 -0700</bug_when>
    <thetext>fixed with r16798.  Will commit test case as a layout test</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54499</commentid>
    <comment_count>3</comment_count>
    <who name="">mitz</who>
    <bug_when>2006-10-05 10:52:24 -0700</bug_when>
    <thetext>Still failing in TOT.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53929</commentid>
    <comment_count>4</comment_count>
      <attachid>10951</attachid>
    <who name="">mitz</who>
    <bug_when>2006-10-06 12:07:40 -0700</bug_when>
    <thetext>Created attachment 10951
A test that fails in the Jerusalem timezone as of r16855</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53503</commentid>
    <comment_count>5</comment_count>
    <who name="Kevin McCullough">kmccullough</who>
    <bug_when>2006-10-11 12:47:25 -0700</bug_when>
    <thetext>&lt;rdar://4777813&gt;

There are several issues here:
1) Dates that shouldn&apos;t exist: for example 
April 25th 1982 2:30am Pacific
because DST happens exactly at 2am, it skipps to 3am and 2:30am should never happen

2) Dates that happen twice: for example
Oct 31, 1982 1:30am PST/PDT
because DST makes 2am go back to 1am, the hour from 1am to 2am will happen twice

3) The History of DST: Some locations did not observer DST for some times (as seen by the command zdump)

Here is a summary of our resolutions
3) According to the spec, history should not take into account what really happened but interpolate from a comparable year, where comparable years are judged by when Jan 1 happens and if the year is a leap year.
This will only happen for dates that fall outside of the 1970-2038 range. if you fall out of that range then you are offset to a comparable year.
This is consistent with what most browsers.

2) To address dates that happen twice, the standard behavior is to pick Standard Time (or the second time the time happens)

1) The final issue is what to do with times that should not have happened.  Some browsers just show the time and some subtract an hour (e.g. 2am becomes 1am).  What we think should happen is that an hour should be added (e.g. 2am becomes 3am).  This has been added as a bug in Radar (number is at the top of this comment)</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="0"
              isprivate="0"
          >
            <attachid>10911</attachid>
            <date>2006-10-04 12:34:21 -0700</date>
            <delta_ts>2006-10-06 12:09:16 -0700</delta_ts>
            <desc>Test case</desc>
            <filename>new-date-DST-pre-1970.html</filename>
            <type>text/html</type>
            <size>989</size>
            <attacher>mitz</attacher>
            
              <data encoding="base64">PGh0bWw+CjxoZWFkPgo8c2NyaXB0PgpmdW5jdGlvbiBwcmludChtZXNzYWdlKSB7CiAgICB2YXIg
cGFyYWdyYXBoID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgicCIpOwogICAgcGFyYWdyYXBoLmFw
cGVuZENoaWxkKGRvY3VtZW50LmNyZWF0ZVRleHROb2RlKG1lc3NhZ2UpKTsKICAgIGRvY3VtZW50
LmdldEVsZW1lbnRCeUlkKCJjb25zb2xlIikuYXBwZW5kQ2hpbGQocGFyYWdyYXBoKTsKfQoKZnVu
Y3Rpb24gdGVzdCgpIHsKICAgIGlmICh3aW5kb3cubGF5b3V0VGVzdENvbnRyb2xsZXIpIHsKICAg
ICAgICBsYXlvdXRUZXN0Q29udHJvbGxlci5kdW1wQXNUZXh0KCk7CiAgICB9CgogICAgdmFyIGRh
dGVzID0gWwogICAgICAgIG5ldyBEYXRlKDE5NjgsIDIsIDE3KSwgICAvLyBmYWlscyBpbiBOWgov
LyAgICAgICAgbmV3IERhdGUoMTk2OSwgOCwgMSksICAgLy8gZmFpbHMgaW4gQ0VULCBBc2lhL0pl
cnVzYWxlbQovLyAgICAgICAgbmV3IERhdGUoMTk2OSwgOSwgMjgpLCAgLy8gZmFpbHMgaW4gVVMv
RWFzdGVybiwgTW91bnRhaW4sIFBhY2lmaWMsIENlbnRyYWwKICAgIF07CiAgICB3aGlsZSAoZCA9
IGRhdGVzLnNoaWZ0KCkpIHsKICAgICAgICBpZiAoZC5nZXRIb3VycygpICE9IDApIHsKICAgICAg
ICAgICAgcHJpbnQoIkZBSUxFRDogIiArIGQpOwogICAgICAgICAgICBicmVhazsKICAgICAgICB9
CiAgICB9CiAgICBpZiAoIWQpCiAgICAgICAgcHJpbnQoIk5vdGhpbmcgZmFpbGVkLiBUaGlzIHRl
c3RzIGNvdmVycyBvbmx5IHRoZSBOWiB0aW1lem9uZSEiKTsKfQo8L3NjcmlwdD4KPC9oZWFkPgo8
Ym9keSBvbmxvYWQ9InRlc3QoKTsiPgo8cD5UaGlzIHRlc3RzIHRoZSBEU1Qgc3RhdHVzIGluIGRh
dGVzIGVhcmxpZXIgdGhhbiAxOTcwLTAxLTAxIDAwOjAwIFVUQy4gUmVnYXJkbGVzcyBvZiB5b3Vy
IHRpbWUgem9uZSwgaXQgc2hvdWxkIG5vdCBmYWlsLjwvcD4KPGhyPgo8ZGl2IGlkPSdjb25zb2xl
Jy8+CjwvYm9keT4KPC9odG1sPgo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>10951</attachid>
            <date>2006-10-06 12:07:40 -0700</date>
            <delta_ts>2006-10-06 12:07:40 -0700</delta_ts>
            <desc>A test that fails in the Jerusalem timezone as of r16855</desc>
            <filename>Jerusalem-date-DST-pre-1970.html</filename>
            <type>text/html</type>
            <size>857</size>
            <attacher>mitz</attacher>
            
              <data encoding="base64">PGh0bWw+CjxoZWFkPgo8c2NyaXB0PgpmdW5jdGlvbiBwcmludChtZXNzYWdlKSB7CiAgICB2YXIg
cGFyYWdyYXBoID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgicCIpOwogICAgcGFyYWdyYXBoLmFw
cGVuZENoaWxkKGRvY3VtZW50LmNyZWF0ZVRleHROb2RlKG1lc3NhZ2UpKTsKICAgIGRvY3VtZW50
LmdldEVsZW1lbnRCeUlkKCJjb25zb2xlIikuYXBwZW5kQ2hpbGQocGFyYWdyYXBoKTsKfQoKZnVu
Y3Rpb24gdGVzdCgpIHsKICAgIGlmICh3aW5kb3cubGF5b3V0VGVzdENvbnRyb2xsZXIpIHsKICAg
ICAgICBsYXlvdXRUZXN0Q29udHJvbGxlci5kdW1wQXNUZXh0KCk7CiAgICB9CgogICAgdmFyIGRh
dGVzID0gWwogICAgICAgIG5ldyBEYXRlKDE5NjgsIDIsIDE1KSwgICAvLyBmYWlscyBpbiBBc2lh
L0plcnVzYWxlbQogICAgXTsKICAgIHdoaWxlIChkID0gZGF0ZXMuc2hpZnQoKSkgewogICAgICAg
IGlmIChkLmdldEhvdXJzKCkgIT0gMCkgewogICAgICAgICAgICBwcmludCgiRkFJTEVEOiAiICsg
ZCk7CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgIH0KICAgIH0KICAgIGlmICghZCkKICAgICAg
ICBwcmludCgiTm90aGluZyBmYWlsZWQuIFRoaXMgdGVzdHMgY292ZXJzIG9ubHkgdGhlIEplcnVz
YWxlbSB0aW1lem9uZSEiKTsKfQo8L3NjcmlwdD4KPC9oZWFkPgo8Ym9keSBvbmxvYWQ9InRlc3Qo
KTsiPgo8cD5UaGlzIHRlc3RzIHRoZSBEU1Qgc3RhdHVzIGluIGRhdGVzIGVhcmxpZXIgdGhhbiAx
OTcwLTAxLTAxIDAwOjAwIFVUQy4gUmVnYXJkbGVzcyBvZiB5b3VyIHRpbWUgem9uZSwgaXQgc2hv
dWxkIG5vdCBmYWlsLjwvcD4KPGhyPgo8ZGl2IGlkPSdjb25zb2xlJy8+CjwvYm9keT4KPC9odG1s
Pgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>