<?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>4142</bug_id>
          
          <creation_ts>2005-07-26 11:06:56 -0700</creation_ts>
          <short_desc>Date object does not always adjust daylight savings correctly</short_desc>
          <delta_ts>2005-10-24 13:45:37 -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>412</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Carsten Guenther">carsten</reporter>
          <assigned_to name="Geoffrey Garen">ggaren</assigned_to>
          <cc>ggaren</cc>
    
    <cc>staikos</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>15202</commentid>
    <comment_count>0</comment_count>
    <who name="Carsten Guenther">carsten</who>
    <bug_when>2005-07-26 11:06:56 -0700</bug_when>
    <thetext>This will fix

    ecma/Date/15.9.4.3.js
    ecma/Date/15.9.5.28-1.js

There seems to be a problem with daylight savings when a time change crosses the daylight savings start/
end dates.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15204</commentid>
    <comment_count>1</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2005-07-26 11:15:11 -0700</bug_when>
    <thetext>(In reply to comment #0)

FYI, Mac IE has the same problem. Win IE and Mac FF don&apos;t.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21276</commentid>
    <comment_count>2</comment_count>
    <who name="George Staikos">staikos</who>
    <bug_when>2005-10-03 12:35:01 -0700</bug_when>
    <thetext>Adding this before the return in KJS::makeTime() fixes it for me:  
  
    // Determine if we passed over a DST change boundary  
    if (!utc) { 
      time_t tval = mktime(t) + utcOffset + int((ms + yearOffset)/1000);  
      struct tm t3;  
      localtime_r(&amp;tval, &amp;t3);  
      t-&gt;tm_isdst = t3.tm_isdst;  
    } 
  
Does not seem to introduce any regressions.  I am a bit worried about overflow  
and rounding though.  It might break down very close to the changeover period.  
  </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21629</commentid>
    <comment_count>3</comment_count>
      <attachid>4271</attachid>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2005-10-09 14:58:00 -0700</bug_when>
    <thetext>Created attachment 4271
Patch

Implemented George&apos;s suggestion.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21634</commentid>
    <comment_count>4</comment_count>
      <attachid>4271</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2005-10-09 16:00:35 -0700</bug_when>
    <thetext>Comment on attachment 4271
Patch

What&apos;s the rationale for calling the local variable &quot;t3&quot;?

The FIXME says &quot;on some systems&quot;, but this will happen on all systems; there&apos;s
no system where time_t has enough range to include all the years we want our
function to handle. So I suggest re-wording it. Otherwise, looks fine.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21751</commentid>
    <comment_count>5</comment_count>
    <who name="George Staikos">staikos</who>
    <bug_when>2005-10-10 15:47:43 -0700</bug_when>
    <thetext>There is already a t and a t2, and although t3 wasn&apos;t perhaps the best sequel, 
I didn&apos;t see fit to leave it out. :-) 
 
And yes, &quot;all systems&quot; is correct.  I don&apos;t know if it&apos;s a realistic problem 
to put more effort into at this time though. </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22834</commentid>
    <comment_count>6</comment_count>
    <who name="John Sullivan">sullivan</who>
    <bug_when>2005-10-24 13:45:37 -0700</bug_when>
    <thetext>I checked this in. It did fix ecma/Date/15.9.5.28-1.js, but ecma/Date/15.9.4.3.js was apparently fixed by 
some earlier checkin.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>4271</attachid>
            <date>2005-10-09 14:58:00 -0700</date>
            <delta_ts>2005-10-09 16:00:35 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>patch-dst.txt</filename>
            <type>text/plain</type>
            <size>957</size>
            <attacher name="Geoffrey Garen">ggaren</attacher>
            
              <data encoding="base64">SW5kZXg6IGtqcy9kYXRlX29iamVjdC5jcHAKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQpSQ1MgZmlsZTogL2N2cy9yb290
L0phdmFTY3JpcHRDb3JlL2tqcy9kYXRlX29iamVjdC5jcHAsdgpyZXRyaWV2aW5nIHJldmlzaW9u
IDEuNTkKZGlmZiAtdSAtcjEuNTkgZGF0ZV9vYmplY3QuY3BwCi0tLSBranMvZGF0ZV9vYmplY3Qu
Y3BwCTQgT2N0IDIwMDUgMDE6NDM6NTggLTAwMDAJMS41OQorKysga2pzL2RhdGVfb2JqZWN0LmNw
cAk5IE9jdCAyMDA1IDIxOjU4OjQzIC0wMDAwCkBAIC0xMDI4LDYgKzEwMjgsMTcgQEAKICAgICAg
IHQtPnRtX3llYXIgPSBiYXNlWWVhciAtIDE5MDA7CiAgICAgfQogCisgICAgLy8gRGV0ZXJtaW5l
IHdoZXRoZXIgRFNUIGlzIGluIGVmZmVjdC4gbWt0aW1lKCkgY2FuJ3QgZG8gdGhpcyBmb3IgdXMg
YmVjYXVzZQorICAgIC8vIGl0IGRvZXNuJ3Qga25vdyBhYm91dCBtcyBhbmQgeWVhck9mZnNldC4K
KyAgICAvLyBGSVhNRTogT24gc29tZSBzeXN0ZW1zLCBjYXN0aW5nIHZhbHVlcyBvZiBsYXJnZSBt
YWduaXR1ZGUgdG8gdGltZV90IChsb25nKSB3aWxsIAorICAgIC8vIHByb2R1Y2UgaW5jb3JyZWN0
IHJlc3VsdHMsIGJ1dCB0aGVyZSdzIG5vIG90aGVyIG9wdGlvbiB3aGVuIGNhbGxpbmcgbG9jYWx0
aW1lX3IoKS4KKyAgICBpZiAoIXV0YykgeyAKKyAgICAgIHRpbWVfdCB0dmFsID0gbWt0aW1lKHQp
ICsgKHRpbWVfdCkoKG1zICsgeWVhck9mZnNldCkgLyAxMDAwKTsgIAorICAgICAgc3RydWN0IHRt
IHQzOyAgCisgICAgICBsb2NhbHRpbWVfcigmdHZhbCwgJnQzKTsgIAorICAgICAgdC0+dG1faXNk
c3QgPSB0My50bV9pc2RzdDsgIAorICAgIH0KKyAgICAKICAgICByZXR1cm4gKG1rdGltZSh0KSAr
IHV0Y09mZnNldCkgKiAxMDAwLjAgKyBtcyArIHllYXJPZmZzZXQ7CiB9CiAK
</data>
<flag name="review"
          id="709"
          type_id="1"
          status="+"
          setter="darin"
    />
          </attachment>
      

    </bug>

</bugzilla>