[Webkit-unassigned] [Bug 9532] New: date setUTCFullYear to setUTCMinutes adding 1 hour in time zone 0

bugzilla-daemon at opendarwin.org bugzilla-daemon at opendarwin.org
Wed Jun 21 09:25:53 PDT 2006


http://bugzilla.opendarwin.org/show_bug.cgi?id=9532

           Summary: date setUTCFullYear to setUTCMinutes adding 1 hour in
                    time zone 0
           Product: WebKit
           Version: 417.x
          Platform: Macintosh
        OS/Version: Mac OS X 10.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at opendarwin.org
        ReportedBy: tobylewis at mac.com


This bug only occurs when the timezone in date & time is set to Europe/London
or any of the others in the 0 zone.  It does not occur in any of the US time
zones.

Setting parts of a date with the local methods (eg setDate()) is fine, but if
any of the UTC methods (eg setUTCDate()) are used one extra hour is added to
the date value.  

This is occuring on all dates and not just ones around the clock change dates.

It happens regardless of whether the change is increasing or decreasing the
date.

It occurs when daylight saving is applicable to the date being edited and when
daylight saving is not.  

Likewise it happens both when the system clock is set to the summer or the
winter.  

Basically it always happens.

the following code demonstrates the problem when the system timezone is set to
Europe/London.  Before and after values are shown using UTC and local methods
and the test is done by setting with a UTC and a local method to show the
difference in the result.  I have checked this behavior against both MSIE
(spit) and Firefox and they both behave as expected (ie differently to Safari).


var test1 = new Date(Date.UTC(2006, 1, 20));
var result = 'changing date with setUTCDate';
result += 'initial UTC: '+test1.getUTCMonth()+'/'+test1.getUTCDate()+' -
'+test1.getUTCHours()+':'+test1.getUTCMinutes();
result += ' local: '+test1.getMonth()+'/'+test1.getDate()+' -
'+test1.getHours()+':'+test1.getMinutes()+'\n';
test1.setUTCDate(15);
result += 'after UTC: '+test1.getUTCMonth()+'/'+test1.getUTCDate()+' -
'+test1.getUTCHours()+':'+test1.getUTCMinutes();
result += ' local: '+test1.getMonth()+'/'+test1.getDate()+' -
'+test1.getHours()+':'+test1.getMinutes()+'\n';

result += 'changing date with setDate';
var test1 = new Date(Date.UTC(2006, 1, 20));
result += 'initial UTC: '+test1.getUTCMonth()+'/'+test1.getUTCDate()+' -
'+test1.getUTCHours()+':'+test1.getUTCMinutes();
result += ' local: '+test1.getMonth()+'/'+test1.getDate()+' -
'+test1.getHours()+':'+test1.getMinutes()+'\n';
test1.setDate(15);
result += 'after UTC: '+test1.getUTCMonth()+'/'+test1.getUTCDate()+' -
'+test1.getUTCHours()+':'+test1.getUTCMinutes();
result += ' local: '+test1.getMonth()+'/'+test1.getDate()+' -
'+test1.getHours()+':'+test1.getMinutes()+'\n';
alert(result);


-- 
Configure bugmail: http://bugzilla.opendarwin.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list