<?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>137140</bug_id>
          
          <creation_ts>2014-09-25 22:45:03 -0700</creation_ts>
          <short_desc>Date.getDate() returns bad values in some time zones</short_desc>
          <delta_ts>2014-09-30 14:47:43 -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>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>137003</dup_id>
          
          <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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Daniel Herbolt">daniel</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>barraclough</cc>
    
    <cc>daniel</cc>
    
    <cc>ggaren</cc>
    
    <cc>mark.lam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1037412</commentid>
    <comment_count>0</comment_count>
    <who name="Daniel Herbolt">daniel</who>
    <bug_when>2014-09-25 22:45:03 -0700</bug_when>
    <thetext>Steps to reproduce
1) Set time zone of your OS X to Sydney - Australia
2) run following code in Safari Developer console
 a)
 //Date &apos;2014-10-05&apos; is the first Sunday in October. It is date when DST is changing in Australia.
 var d = new Date(2014, 9, 5, 0, 0, 0, 0); // 2014-10-05 00:00:00
 d.toString();

 b) new Date(2014, 9, 5, 0, 0, 0, 0).getDate();
3) see result in console

Expexcted result:
2a) Sun Oct 05 2014 00:00:00 GMT+1000 (EST)
2b) 5

Actual result:
2a) Sat Oct 04 2014 23:00:00 GMT+1000 (EST)
2b) 4


Additional info:
 - APPLE BUG ID #13201479
 - http://www.timeanddate.com/time/aboutdst.html
 - http://stackoverflow.com/questions/14839244/why-is-safari-confused-about-date-getday-for-dst-start-in-sydney-aus-time-zon

 - It is also reproducible with New Zealand time zone with different date. Affected date is date of DST change.


Used software
Safari 7.1, Safari 8.0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1038112</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2014-09-29 16:45:45 -0700</bug_when>
    <thetext>Same as bug 137003?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1038155</commentid>
    <comment_count>2</comment_count>
    <who name="Daniel Herbolt">daniel</who>
    <bug_when>2014-09-29 22:46:55 -0700</bug_when>
    <thetext>(In reply to comment #1)
&gt; Same as bug 137003?

Yes, it looks as the same problem for New Zealand time zone.

1) Set time zone of your OS X to Wellington - New Zealand
2) run following code in Safari Developer console
 a)
 var d = new Date(2014, 8, 28, 0, 0, 0, 0);
 d.toString();

 b) new Date(2014, 8, 28, 0, 0, 0, 0).getDate();
3) see result in console

Expexcted result:
2a) Sun Sep 28 2014 00:00:00 GMT+1200 (NZST)
2b) 28

Actual result:
2a) Sat Sep 27 2014 23:00:00 GMT+1200 (NZST)
2b) 27</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1038357</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2014-09-30 14:47:43 -0700</bug_when>
    <thetext>Thank you for confirming, duping to the older bug.

*** This bug has been marked as a duplicate of bug 137003 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>