<?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>137458</bug_id>
          
          <creation_ts>2014-10-06 13:23:07 -0700</creation_ts>
          <short_desc>[Win] DateMath&apos;s calculateUTCOffset does not account for Daylight Savings Time</short_desc>
          <delta_ts>2014-10-06 18:15:26 -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>WebCore Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>137473</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Brent Fulgham">bfulgham</reporter>
          <assigned_to name="Brent Fulgham">bfulgham</assigned_to>
          <cc>benjamin</cc>
    
    <cc>bfulgham</cc>
    
    <cc>cmarcelo</cc>
    
    <cc>commit-queue</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1039802</commentid>
    <comment_count>0</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2014-10-06 13:23:07 -0700</bug_when>
    <thetext>The code for the Windows path of &quot;calculateUTCOffset&quot; ignores the return value of GetTimeZoneInformation, and always acts as though the running machine is in the standard time zone.

This documentation in &lt;http://msdn.microsoft.com/en-us/library/windows/desktop/ms724421(v=vs.85).aspx&gt; clearly indicates a daylight-savings-time-specific return value that indicates that you should use the &quot;daylight bias&quot; portion of the time zone struct to calculate the correct offset.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1039803</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2014-10-06 13:24:12 -0700</bug_when>
    <thetext>&lt;rdar://problem/18559172&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1039804</commentid>
    <comment_count>2</comment_count>
      <attachid>239351</attachid>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2014-10-06 13:30:43 -0700</bug_when>
    <thetext>Created attachment 239351
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1039805</commentid>
    <comment_count>3</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2014-10-06 13:31:11 -0700</bug_when>
    <thetext>This bug may be why certain date-related tests are failing depending on user&apos;s time zone.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1039806</commentid>
    <comment_count>4</comment_count>
      <attachid>239351</attachid>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2014-10-06 13:34:35 -0700</bug_when>
    <thetext>Comment on attachment 239351
Patch

r=me

It would be nice to get clarity on whether our existing tests cover this, and to add a test to cover this if it&apos;s not already covered.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1039894</commentid>
    <comment_count>5</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2014-10-06 17:39:35 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; (From update of attachment 239351 [details])
&gt; r=me
&gt; 
&gt; It would be nice to get clarity on whether our existing tests cover this, and to add a test to cover this if it&apos;s not already covered.

We have tests that check for correct calculation of DST-related dates, but we don&apos;t have a test that places the test machine in DST or Standard time zones for running the tests. This patch corrects a problem where the local machine state was not being accounted for when computed the time offset compared to UTC.

I&apos;ll think about this and see if we can come up with a reliable way to toggle this state during test runs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1039896</commentid>
    <comment_count>6</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2014-10-06 17:42:19 -0700</bug_when>
    <thetext>See also &lt;https://bugs.webkit.org/show_bug.cgi?id=137473&gt; for better testing for this feature.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1039908</commentid>
    <comment_count>7</comment_count>
      <attachid>239351</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2014-10-06 18:15:22 -0700</bug_when>
    <thetext>Comment on attachment 239351
Patch

Clearing flags on attachment: 239351

Committed r174377: &lt;http://trac.webkit.org/changeset/174377&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1039909</commentid>
    <comment_count>8</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2014-10-06 18:15:26 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>239351</attachid>
            <date>2014-10-06 13:30:43 -0700</date>
            <delta_ts>2014-10-06 18:15:22 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-137458-20141006133339.patch</filename>
            <type>text/plain</type>
            <size>2627</size>
            <attacher name="Brent Fulgham">bfulgham</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XVEYvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFNvdXJjZS9XVEYvQ2hh
bmdlTG9nCShyZXZpc2lvbiAxNzQzNjApCisrKyBTb3VyY2UvV1RGL0NoYW5nZUxvZwkod29ya2lu
ZyBjb3B5KQpAQCAtMSwzICsxLDI0IEBACisyMDE0LTEwLTA2ICBCcmVudCBGdWxnaGFtICA8YmZ1
bGdoYW1AYXBwbGUuY29tPgorCisgICAgICAgIFtXaW5dIERhdGVNYXRoJ3MgY2FsY3Vs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FByb2plY3QgZmlsZSBnYXJkZW5pbmcuCkluZGV4OiBTb3VyY2UvV1RGL3d0Zi9EYXRlTWF0
aC5jcHAKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PQotLS0gU291cmNlL1dURi93dGYvRGF0ZU1hdGguY3BwCShyZXZpc2lv
biAxNzQzNjApCisrKyBTb3VyY2UvV1RGL3d0Zi9EYXRlTWF0aC5jcHAJKHdvcmtpbmcgY29weSkK
QEAgLTM2Nyw4ICszNjcsMTYgQEAgc3RhdGljIGludDMyX3QgY2FsY3VsYXRlVVRDT2Zmc2V0KCkK
IHsKICNpZiBPUyhXSU5ET1dTKQogICAgIFRJTUVfWk9ORV9JTkZPUk1BVElPTiB0aW1lWm9uZUlu
Zm9ybWF0aW9uOwotICAgIEdldFRpbWVab25lSW5mb3JtYXRpb24oJnRpbWVab25lSW5mb3JtYXRp
b24pOwotICAgIGludDMyX3QgYmlhcyA9IHRpbWVab25lSW5mb3JtYXRpb24uQmlhcyArIHRpbWVa
b25lSW5mb3JtYXRpb24uU3RhbmRhcmRCaWFzOworICAgIERXT1JEIHJjID0gOjpHZXRUaW1lWm9u
ZUluZm9ybWF0aW9uKCZ0aW1lWm9uZUluZm9ybWF0aW9uKTsKKyAgICBpZiAocmMgPT0gVElNRV9a
T05FX0lEX0lOVkFMSUQpCisgICAgICAgIHJldHVybiAwOworCisgICAgaW50MzJfdCBiaWFzID0g
MDsKKyAgICBpZiAocmMgPT0gVElNRV9aT05FX0lEX0RBWUxJR0hUKQorICAgICAgICBiaWFzID0g
dGltZVpvbmVJbmZvcm1hdGlvbi5CaWFzICsgdGltZVpvbmVJbmZvcm1hdGlvbi5EYXlsaWdodEJp
YXM7CisgICAgZWxzZSBpZiAocmMgPT0gVElNRV9aT05FX0lEX1NUQU5EQVJEIHx8IHJjID09IFRJ
TUVfWk9ORV9JRF9VTktOT1dOKQorICAgICAgICBiaWFzID0gdGltZVp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