Hi Anton & Kevin,

we read your comments in the JDK bug system and analyzed WebKit's changesets 
again.

We’ve found the code which made this regression.



http://trac.webkit.org/changeset/159892



This changeset doesn't handle one special case, which was handled by the 
previous code....


    double diff = ((localSystemTime.wHour - offsetHour) * secondsPerHour) + 
((localSystemTime.wMinute - offsetMinute) * 60);



(http://trac.webkit.org/browser/trunk/Source/WTF/wtf/DateMath.cpp?annotate=blame#L481
 )



The diff is wrong if the calculated the offsetTime is one day before in case of 
the extreme values (e.g. midnight) where the offsetHour of the UTC time is  23 
because of the day difference.



In case of all other OS systems you will see the same code -> 
http://trac.webkit.org/browser/trunk/Source/WTF/wtf/DateMath.cpp?annotate=blame#L495



But there are  two  additional lines ->  497 & 497 which fixes this special 
case…



if (diff < 0)
        diff += secondsPerDay;





That means ….



localSystemTime.wHour = 0;

offsetHour=23 … which causes a negative value … and the diff+=secondsPerDay 
ensures that the diff result would be one Hour instead of -23 hours



We’ve found the attached V8DateTests.js (renamed to .txt) and adjusted it a 
little bit to get the results logged in the browsers console.

As you can see at “ResulBeforeOurBugFix.txt” and “ResultAfterOurBugFix.txt”, we 
were able to fix 6 tests which failed before out bug fix.



assertEquals("Sat Oct 25 2014 23:00:00 GMT+0200 (W. Europe Daylight Time)",

               (new Date(2014, 9, 25, 23, 0)).toString());

  assertEquals("Sat, 25 Oct 2014 21:00:00 GMT",

               (new Date(2014, 9, 25, 23, 0)).toUTCString());

  assertEquals("Sat Oct 25 2014 23:59:00 GMT+0200 (W. Europe Daylight Time)",

               (new Date(2014, 9, 25, 23, 59)).toString());

  assertEquals("Sat, 25 Oct 2014 21:59:00 GMT",

               (new Date(2014, 9, 25, 23, 59)).toUTCString());

  assertEquals("Sun Oct 26 2014 00:00:00 GMT+0200 (W. Europe Daylight Time)",

              (new Date(2014, 9, 26, 0, 0)).toString());

assertEquals("Sun Oct 26 2014 00:59:00 GMT+0200 (W. Europe Daylight Time)",

               (new Date(2014, 9, 26, 0, 59)).toString());



In addition we found out that WebKit also have problems in case of Windows in 
case of the change from winter to summer time.



Winter to summer time:

assertEquals("Sun Mar 30 2014 03:00:00 GMT+0200 (W. Europe Daylight Time)",

               (new Date(2014, 2, 30, 2, 0)).toString());

  assertEquals("Sun, 30 Mar 2014 01:00:00 GMT",

               (new Date(2014, 2, 30, 2, 0)).toUTCString());

  assertEquals("Sun Mar 30 2014 03:59:00 GMT+0200 (W. Europe Daylight Time)",

               (new Date(2014, 2, 30, 2, 59)).toString());

  assertEquals("Sun, 30 Mar 2014 01:59:00 GMT",

               (new Date(2014, 2, 30, 2, 59)).toUTCString());



Summer to winter time:

assertEquals("Sun Oct 26 2014 02:00:00 GMT+0200 (W. Europe Daylight Time)",

               (new Date(2014, 9, 26, 2, 0)).toString());

  assertEquals("Sun, 26 Oct 2014 00:00:00 GMT",

               (new Date(2014, 9, 26, 2, 0)).toUTCString());

  assertEquals("Sun Oct 26 2014 02:59:00 GMT+0200 (W. Europe Daylight Time)",

               (new Date(2014, 9, 26, 2, 59)).toString());

  assertEquals("Sun, 26 Oct 2014 00:59:00 GMT",

               (new Date(2014, 9, 26, 2, 59)).toUTCString());



We will try to find a solution for that, but I think that the priority of this 
issue is lower than the priority of the opened regression.



It would be amazing if you can add the patch of my previous and these 
additional two lines (DateMath.cpp) to the JDK8u60.



Best Regards,

Steve





Diese E-Mail wurde versandt im Auftrag des Unternehmens Intergraph Ges.m.b.H.
Vertretungsberechtigte Geschäftsführer: Maximilian Weber
Sitz der Gesellschaft: Margaretenstraße 70/I/1, 1050 Wien, Österreich, Tel. +43 
(1) 9610567-0
Eingetragen beim Handelsgericht Wien, Firmenbuch-Nr.: FN 116859 b
Umsatzsteuer-Identifikationsnummer / VAT-ID: ATU15138401, Steuer-Nummer: 
264/4807

This E-Mail has been sent on behalf of the company Intergraph Ges.m.b.H.
Authorised Managing Directors: Maximilian Weber
Registered office and Austrian headquarters: Margaretenstr. 70/I/1, 1050 Wien, 
Austria, Tel. +43 (1) 9610567-0
The company is recorded at the commercial court of Vienna under the company 
register number FN 116859 b
VAT-ID: ATU15138401, Austrian Tax ID: 264/4807

Diese E-Mail (mit zugehörigen Dateien) enthält möglicherweise Informationen, 
die vertraulich sind, dem Urheberrecht unterliegen oder ein Geschäftsgeheimnis 
darstellen. Falls Sie diese Nachricht irrtümlicherweise erhalten haben, 
benachrichtigen Sie uns bitte umgehend, indem Sie eine Antwort senden, und 
löschen Sie bitte diese E-Mail und Ihre Antwort darauf. Sämtliche aufgeführten 
Ansichten oder Meinungen sind ausschließlich diejenigen des Autors und 
entsprechen nicht notwendigerweise denen des Unternehmens Intergraph.

This E-Mail (and any attachments) may be confidential and protected by legal 
privilege. If you are not the intended recipient please notify us immediately 
by replying to the sender and delete this E-Mail and your reply from your 
system. All the views and opinions published here are solely based on the 
author's own opinion and should not be considered necessarily as reflecting the 
opinion of Intergraph.





-----Original Message-----

From: openjfx-dev [mailto:openjfx-dev-boun...@openjdk.java.net] On Behalf Of 
Hruda, Steve

Sent: Tuesday, June 23, 2015 6:26 PM

To: Anton V. Tarasov; Kevin Rushforth

Cc: openjfx-dev@openjdk.java.net

Subject: RE: Patch for JDK-8090098 - [regression] Webview - getTimezoneOffset() 
of a ISO strings returns a wrong value



Very cool Anton.



I would be great if that pach could be added to 8u60, otherwise our all our 
customers have to avoid Java 8u60.



Regards,

Steve









Diese E-Mail wurde versandt im Auftrag des Unternehmens Intergraph Ges.m.b.H.

Vertretungsberechtigte Geschäftsführer: Maximilian Weber Sitz der Gesellschaft: 
Margaretenstraße 70/I/1, 1050 Wien, Österreich, Tel. +43 (1) 9610567-0 
Eingetragen beim Handelsgericht Wien, Firmenbuch-Nr.: FN 116859 b 
Umsatzsteuer-Identifikationsnummer / VAT-ID: ATU15138401, Steuer-Nummer: 
264/4807



This E-Mail has been sent on behalf of the company Intergraph Ges.m.b.H.

Authorised Managing Directors: Maximilian Weber Registered office and Austrian 
headquarters: Margaretenstr. 70/I/1, 1050 Wien, Austria, Tel. +43 (1) 9610567-0 
The company is recorded at the commercial court of Vienna under the company 
register number FN 116859 b

VAT-ID: ATU15138401, Austrian Tax ID: 264/4807



Diese E-Mail (mit zugehörigen Dateien) enthält möglicherweise Informationen, 
die vertraulich sind, dem Urheberrecht unterliegen oder ein Geschäftsgeheimnis 
darstellen. Falls Sie diese Nachricht irrtümlicherweise erhalten haben, 
benachrichtigen Sie uns bitte umgehend, indem Sie eine Antwort senden, und 
löschen Sie bitte diese E-Mail und Ihre Antwort darauf. Sämtliche aufgeführten 
Ansichten oder Meinungen sind ausschließlich diejenigen des Autors und 
entsprechen nicht notwendigerweise denen des Unternehmens Intergraph.



This E-Mail (and any attachments) may be confidential and protected by legal 
privilege. If you are not the intended recipient please notify us immediately 
by replying to the sender and delete this E-Mail and your reply from your 
system. All the views and opinions published here are solely based on the 
author's own opinion and should not be considered necessarily as reflecting the 
opinion of Intergraph.





-----Original Message-----

From: Anton V. Tarasov [mailto:anton.tara...@oracle.com]

Sent: Tuesday, June 23, 2015 5:46 PM

To: Kevin Rushforth; Hruda, Steve

Cc: openjfx-dev@openjdk.java.net

Subject: Re: Patch for JDK-8090098 - [regression] Webview - getTimezoneOffset() 
of a ISO strings returns a wrong value



On 23.06.2015 17:48, Kevin Rushforth wrote:

> Hi Steve,

>

> Thank you for taking the time to create this patch. I will add this 
> information to the bug report.

>

> Since your OCA is in progress we will take a look at your patch, but

> will need indication from the OCA office that it the OCA has been

> received before we could push it. And just to be clear, you won't have

> access to the repository even with an OCA. What the OCA will do is allow you 
> to contribute patches.

>

> I will note that it is likely too late for 8u60, but Anton can

> evaluate it and post his comment in the bug report.



Kevin,



I'm checking it.



Steve, thanks for the participation!



Regards,

Anton.



>

> -- Kevin

>

>

> Hruda, Steve wrote:

>> Hi,

>> I've created a 8u-dev patch for the following WeKit regression which comes 
>> with 8u60.

>> https://bugs.openjdk.java.net/browse/JDK-8090098

>>

>> Please can someone of you apply this patch to fix the

>> getTimezoneOffset() issue. I have no access to the repository -> my OCA is 
>> still pending.

>>

>> In addition I tried to test this patch , but I wasn't able to build

>> the necessary jfxwebkit.dll on my windows system

>> (https://www.mail-archive.com/openjfx-dev@openjdk.java.net/msg09439.h

>> tml )..... but I got no compile erros on Mac.

>>

>> Patch download:

>> https://drive.google.com/file/d/0B7P_rknS1TWxM3BSTTU2OVZ4dGM/view?usp

>> =sharing

>>

>> The patch includes the following WebKit fixes:

>> Changeset 174377  - [Win] DateMath's calculateUTFOffset does not account for 
>> DST.

>> http://trac.webkit.org/changeset/174377

>>

>> Changeset 175078  - String(new Date(Mar 30 2014 01:00:00)) is wrong

>> in CET

>> http://trac.webkit.org/changeset/175078

>>

>> Changeset 181360 - [Win] 17 different JSC tests started to fail in

>> DST

>> http://trac.webkit.org/changeset/181360

>>

>> Please let me know if you need further information.

>>

>> Thanks in advance!

>> Best Regards

>> Steve

>>

>>

>>

>> Diese E-Mail wurde versandt im Auftrag des Unternehmens Intergraph Ges.m.b.H.

>> Vertretungsberechtigte Geschäftsführer: Maximilian Weber Sitz der

>> Gesellschaft: Margaretenstraße 70/I/1, 1050 Wien, Österreich, Tel.

>> +43 (1) 9610567-0 Eingetragen beim Handelsgericht Wien,

>> Firmenbuch-Nr.: FN 116859 b Umsatzsteuer-Identifikationsnummer /

>> VAT-ID: ATU15138401, Steuer-Nummer: 264/4807

>>

>> This E-Mail has been sent on behalf of the company Intergraph Ges.m.b.H.

>> Authorised Managing Directors: Maximilian Weber Registered office and

>> Austrian headquarters: Margaretenstr. 70/I/1, 1050 Wien, Austria,

>> Tel. +43

>> (1) 9610567-0

>> The company is recorded at the commercial court of Vienna under the

>> company register number FN

>> 116859 b

>> VAT-ID: ATU15138401, Austrian Tax ID: 264/4807

>>

>> Diese E-Mail (mit zugehörigen Dateien) enthält möglicherweise

>> Informationen, die vertraulich sind, dem Urheberrecht unterliegen

>> oder ein Geschäftsgeheimnis darstellen. Falls Sie diese Nachricht

>> irrtümlicherweise erhalten haben, benachrichtigen Sie uns bitte

>> umgehend, indem Sie eine Antwort senden, und löschen Sie bitte diese

>> E-Mail und Ihre Antwort darauf. Sämtliche aufgeführten Ansichten oder 
>> Meinungen sind ausschließlich diejenigen des Autors und entsprechen nicht 
>> notwendigerweise denen des Unternehmens Intergraph.

>>

>> This E-Mail (and any attachments) may be confidential and protected

>> by legal privilege. If you are not the intended recipient please

>> notify us immediately by replying to the sender and delete this

>> E-Mail and your reply from your system. All the views and opinions

>> published here are solely based on the author's own opinion and should not 
>> be considered necessarily as reflecting the opinion of Intergraph.

>>

>>


Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Sun Mar 30 2014 03:00:00 GMT+0200 (W. Europe Daylight Time) !== Sun Mar 30 2014 
01:00:00 GMT+0100 (W. Europe Standard Time)
Sun, 30 Mar 2014 01:00:00 GMT !== Sun, 30 Mar 2014 00:00:00 GMT
Sun Mar 30 2014 03:59:00 GMT+0200 (W. Europe Daylight Time) !== Sun Mar 30 2014 
01:59:00 GMT+0100 (W. Europe Standard Time)
Sun, 30 Mar 2014 01:59:00 GMT !== Sun, 30 Mar 2014 00:59:00 GMT
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Sat Oct 25 2014 23:00:00 GMT+0200 (W. Europe Daylight Time) !== Sun Oct 26 2014 
22:00:00 GMT+0100 (W. Europe Standard Time)
Sat, 25 Oct 2014 21:00:00 GMT !== Sun, 26 Oct 2014 21:00:00 GMT
Sat Oct 25 2014 23:59:00 GMT+0200 (W. Europe Daylight Time) !== Sun Oct 26 2014 
22:59:00 GMT+0100 (W. Europe Standard Time)
Sat, 25 Oct 2014 21:59:00 GMT !== Sun, 26 Oct 2014 21:59:00 GMT
Sun Oct 26 2014 00:00:00 GMT+0200 (W. Europe Daylight Time) !== Sat Oct 25 2014 
00:00:00 GMT-2200 (W. Europe Daylight Time)
Ok
Sun Oct 26 2014 00:59:00 GMT+0200 (W. Europe Daylight Time) !== Sat Oct 25 2014 
00:59:00 GMT-2200 (W. Europe Daylight Time)
Ok
Ok
Ok
Ok
Ok
Sun Oct 26 2014 02:00:00 GMT+0200 (W. Europe Daylight Time) !== Sun Oct 26 2014 
02:00:00 GMT+0100 (W. Europe Standard Time)
Sun, 26 Oct 2014 00:00:00 GMT !== Sun, 26 Oct 2014 01:00:00 GMT
Sun Oct 26 2014 02:59:00 GMT+0200 (W. Europe Daylight Time) !== Sun Oct 26 2014 
02:59:00 GMT+0100 (W. Europe Standard Time)
Sun, 26 Oct 2014 00:59:00 GMT !== Sun, 26 Oct 2014 01:59:00 GMT
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Sun Mar 30 2014 03:00:00 GMT+0200 (W. Europe Daylight Time) !== Sun Mar 30 2014 
01:00:00 GMT+0100 (W. Europe Standard Time)
Sun, 30 Mar 2014 01:00:00 GMT !== Sun, 30 Mar 2014 00:00:00 GMT
Sun Mar 30 2014 03:59:00 GMT+0200 (W. Europe Daylight Time) !== Sun Mar 30 2014 
01:59:00 GMT+0100 (W. Europe Standard Time)
Sun, 30 Mar 2014 01:59:00 GMT !== Sun, 30 Mar 2014 00:59:00 GMT
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Ok
Sun Oct 26 2014 02:00:00 GMT+0200 (W. Europe Daylight Time) !== Sun Oct 26 2014 
02:00:00 GMT+0100 (W. Europe Standard Time)
Sun, 26 Oct 2014 00:00:00 GMT !== Sun, 26 Oct 2014 01:00:00 GMT
Sun Oct 26 2014 02:59:00 GMT+0200 (W. Europe Daylight Time) !== Sun Oct 26 2014 
02:59:00 GMT+0100 (W. Europe Standard Time)
Sun, 26 Oct 2014 00:59:00 GMT !== Sun, 26 Oct 2014 01:59:00 GMT
Ok
Ok
Ok
Ok
Ok
Ok
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

function assertEquals(a, b) {
 if (a===b)
        document.getElementById('output').innerHTML += 'Ok<br>';
 else
        document.getElementById('output').innerHTML += a + ' !== ' + b + 
'<br>';  
}

function timezone(tz) {
  var str = (new Date(2014, 0, 10)).toString();
  if (tz == "W. Europe Standard Time") {
    return str == "Fri Jan 10 2014 00:00:00 GMT+0100 (W. Europe Standard Time)";
  }
  if (tz == "BRT") {
    return str == "Fri Jan 10 2014 00:00:00 GMT-0200 (BRST)";
  }
  if (tz == "PST") {
    return str == "Fri Jan 10 2014 00:00:00 GMT-0800 (PST)";
  }
  return false;
}

if (timezone("W. Europe Standard Time")) {
  assertEquals("Sat Mar 29 2014 22:59:00 GMT+0100 (W. Europe Standard Time)",
               (new Date(2014, 2, 29, 22, 59)).toString());
  assertEquals("Sat, 29 Mar 2014 21:59:00 GMT",
               (new Date(2014, 2, 29, 22, 59)).toUTCString());
  assertEquals("Sat Mar 29 2014 23:00:00 GMT+0100 (W. Europe Standard Time)",
               (new Date(2014, 2, 29, 23, 0)).toString());
  assertEquals("Sat, 29 Mar 2014 22:00:00 GMT",
               (new Date(2014, 2, 29, 23, 0)).toUTCString());
  assertEquals("Sat Mar 29 2014 23:59:00 GMT+0100 (W. Europe Standard Time)",
               (new Date(2014, 2, 29, 23, 59)).toString());
  assertEquals("Sat, 29 Mar 2014 22:59:00 GMT",
               (new Date(2014, 2, 29, 23, 59)).toUTCString());
  assertEquals("Sun Mar 30 2014 00:00:00 GMT+0100 (W. Europe Standard Time)",
               (new Date(2014, 2, 30, 0, 0)).toString());
  assertEquals("Sat, 29 Mar 2014 23:00:00 GMT",
               (new Date(2014, 2, 30, 0, 0)).toUTCString());
  assertEquals("Sun Mar 30 2014 00:59:00 GMT+0100 (W. Europe Standard Time)",
               (new Date(2014, 2, 30, 0, 59)).toString());
  assertEquals("Sat, 29 Mar 2014 23:59:00 GMT",
               (new Date(2014, 2, 30, 0, 59)).toUTCString());
  assertEquals("Sun Mar 30 2014 01:00:00 GMT+0100 (W. Europe Standard Time)",
               (new Date(2014, 2, 30, 1, 0)).toString());
  assertEquals("Sun, 30 Mar 2014 00:00:00 GMT",
               (new Date(2014, 2, 30, 1, 0)).toUTCString());
  assertEquals("Sun Mar 30 2014 01:59:00 GMT+0100 (W. Europe Standard Time)",
               (new Date(2014, 2, 30, 1, 59)).toString());
  assertEquals("Sun, 30 Mar 2014 00:59:00 GMT",
               (new Date(2014, 2, 30, 1, 59)).toUTCString());
  assertEquals("Sun Mar 30 2014 03:00:00 GMT+0200 (W. Europe Daylight Time)",
               (new Date(2014, 2, 30, 2, 0)).toString());
  assertEquals("Sun, 30 Mar 2014 01:00:00 GMT",
               (new Date(2014, 2, 30, 2, 0)).toUTCString());
  assertEquals("Sun Mar 30 2014 03:59:00 GMT+0200 (W. Europe Daylight Time)",
               (new Date(2014, 2, 30, 2, 59)).toString());
  assertEquals("Sun, 30 Mar 2014 01:59:00 GMT",
               (new Date(2014, 2, 30, 2, 59)).toUTCString());
  assertEquals("Sun Mar 30 2014 03:00:00 GMT+0200 (W. Europe Daylight Time)",
               (new Date(2014, 2, 30, 3, 0)).toString());
  assertEquals("Sun, 30 Mar 2014 01:00:00 GMT",
               (new Date(2014, 2, 30, 3, 0)).toUTCString());
  assertEquals("Sun Mar 30 2014 03:59:00 GMT+0200 (W. Europe Daylight Time)",
               (new Date(2014, 2, 30, 3, 59)).toString());
  assertEquals("Sun, 30 Mar 2014 01:59:00 GMT",
               (new Date(2014, 2, 30, 3, 59)).toUTCString());
  assertEquals("Sun Mar 30 2014 04:00:00 GMT+0200 (W. Europe Daylight Time)",
               (new Date(2014, 2, 30, 4, 0)).toString());
  assertEquals("Sun, 30 Mar 2014 02:00:00 GMT",
               (new Date(2014, 2, 30, 4, 0)).toUTCString());
  assertEquals("Sat Oct 25 2014 22:59:00 GMT+0200 (W. Europe Daylight Time)",
               (new Date(2014, 9, 25, 22, 59)).toString());
  assertEquals("Sat, 25 Oct 2014 20:59:00 GMT",
               (new Date(2014, 9, 25, 22, 59)).toUTCString());
  assertEquals("Sat Oct 25 2014 23:00:00 GMT+0200 (W. Europe Daylight Time)",
               (new Date(2014, 9, 25, 23, 0)).toString());
  assertEquals("Sat, 25 Oct 2014 21:00:00 GMT",
               (new Date(2014, 9, 25, 23, 0)).toUTCString());
  assertEquals("Sat Oct 25 2014 23:59:00 GMT+0200 (W. Europe Daylight Time)",
               (new Date(2014, 9, 25, 23, 59)).toString());
  assertEquals("Sat, 25 Oct 2014 21:59:00 GMT",
               (new Date(2014, 9, 25, 23, 59)).toUTCString());
  assertEquals("Sun Oct 26 2014 00:00:00 GMT+0200 (W. Europe Daylight Time)",
               (new Date(2014, 9, 26, 0, 0)).toString());
  assertEquals("Sat, 25 Oct 2014 22:00:00 GMT",
               (new Date(2014, 9, 26, 0, 0)).toUTCString());
  assertEquals("Sun Oct 26 2014 00:59:00 GMT+0200 (W. Europe Daylight Time)",
               (new Date(2014, 9, 26, 0, 59)).toString());
  assertEquals("Sat, 25 Oct 2014 22:59:00 GMT",
               (new Date(2014, 9, 26, 0, 59)).toUTCString());
  assertEquals("Sun Oct 26 2014 01:00:00 GMT+0200 (W. Europe Daylight Time)",
               (new Date(2014, 9, 26, 1, 0)).toString());
  assertEquals("Sat, 25 Oct 2014 23:00:00 GMT",
               (new Date(2014, 9, 26, 1, 0)).toUTCString());
  assertEquals("Sun Oct 26 2014 01:59:00 GMT+0200 (W. Europe Daylight Time)",
               (new Date(2014, 9, 26, 1, 59)).toString());
  assertEquals("Sat, 25 Oct 2014 23:59:00 GMT",
               (new Date(2014, 9, 26, 1, 59)).toUTCString());
  assertEquals("Sun Oct 26 2014 02:00:00 GMT+0200 (W. Europe Daylight Time)",
               (new Date(2014, 9, 26, 2, 0)).toString());
  assertEquals("Sun, 26 Oct 2014 00:00:00 GMT",
               (new Date(2014, 9, 26, 2, 0)).toUTCString());
  assertEquals("Sun Oct 26 2014 02:59:00 GMT+0200 (W. Europe Daylight Time)",
               (new Date(2014, 9, 26, 2, 59)).toString());
  assertEquals("Sun, 26 Oct 2014 00:59:00 GMT",
               (new Date(2014, 9, 26, 2, 59)).toUTCString());
  assertEquals("Sun Oct 26 2014 03:00:00 GMT+0100 (W. Europe Standard Time)",
               (new Date(2014, 9, 26, 3, 0)).toString());
  assertEquals("Sun, 26 Oct 2014 02:00:00 GMT",
               (new Date(2014, 9, 26, 3, 0)).toUTCString());
  assertEquals("Sun Oct 26 2014 03:59:00 GMT+0100 (W. Europe Standard Time)",
               (new Date(2014, 9, 26, 3, 59)).toString());
  assertEquals("Sun, 26 Oct 2014 02:59:00 GMT",
               (new Date(2014, 9, 26, 3, 59)).toUTCString());
  assertEquals("Sun Oct 26 2014 04:00:00 GMT+0100 (W. Europe Standard Time)",
               (new Date(2014, 9, 26, 4, 0)).toString());
  assertEquals("Sun, 26 Oct 2014 03:00:00 GMT",
               (new Date(2014, 9, 26, 4, 0)).toUTCString());
}

if (timezone("BRT")) {
  assertEquals("Sat Oct 18 2014 22:59:00 GMT-0300 (BRT)",
               (new Date(2014, 9, 18, 22, 59)).toString());
  assertEquals("Sun, 19 Oct 2014 01:59:00 GMT",
               (new Date(2014, 9, 18, 22, 59)).toUTCString());
  assertEquals("Sat Oct 18 2014 23:00:00 GMT-0300 (BRT)",
               (new Date(2014, 9, 18, 23, 0)).toString());
  assertEquals("Sun, 19 Oct 2014 02:00:00 GMT",
               (new Date(2014, 9, 18, 23, 0)).toUTCString());
  assertEquals("Sat Oct 18 2014 23:59:00 GMT-0300 (BRT)",
               (new Date(2014, 9, 18, 23, 59)).toString());
  assertEquals("Sun, 19 Oct 2014 02:59:00 GMT",
               (new Date(2014, 9, 18, 23, 59)).toUTCString());
  assertEquals("Sun Oct 19 2014 01:00:00 GMT-0200 (BRST)",
               (new Date(2014, 9, 19, 0, 0)).toString());
  assertEquals("Sun, 19 Oct 2014 03:00:00 GMT",
               (new Date(2014, 9, 19, 0, 0)).toUTCString());
  assertEquals("Sun Oct 19 2014 01:59:00 GMT-0200 (BRST)",
               (new Date(2014, 9, 19, 0, 59)).toString());
  assertEquals("Sun, 19 Oct 2014 03:59:00 GMT",
               (new Date(2014, 9, 19, 0, 59)).toUTCString());
  assertEquals("Sun Oct 19 2014 01:00:00 GMT-0200 (BRST)",
               (new Date(2014, 9, 19, 1, 0)).toString());
  assertEquals("Sun, 19 Oct 2014 03:00:00 GMT",
               (new Date(2014, 9, 19, 1, 0)).toUTCString());
  assertEquals("Sun Oct 19 2014 01:59:00 GMT-0200 (BRST)",
               (new Date(2014, 9, 19, 1, 59)).toString());
  assertEquals("Sun, 19 Oct 2014 03:59:00 GMT",
               (new Date(2014, 9, 19, 1, 59)).toUTCString());
  assertEquals("Sun Oct 19 2014 02:00:00 GMT-0200 (BRST)",
               (new Date(2014, 9, 19, 2, 0)).toString());
  assertEquals("Sun, 19 Oct 2014 04:00:00 GMT",
               (new Date(2014, 9, 19, 2, 0)).toUTCString());
  assertEquals("Sun Oct 19 2014 02:59:00 GMT-0200 (BRST)",
               (new Date(2014, 9, 19, 2, 59)).toString());
  assertEquals("Sun, 19 Oct 2014 04:59:00 GMT",
               (new Date(2014, 9, 19, 2, 59)).toUTCString());
  assertEquals("Sun Oct 19 2014 03:00:00 GMT-0200 (BRST)",
               (new Date(2014, 9, 19, 3, 0)).toString());
  assertEquals("Sun, 19 Oct 2014 05:00:00 GMT",
               (new Date(2014, 9, 19, 3, 0)).toUTCString());
  assertEquals("Sun Oct 19 2014 03:59:00 GMT-0200 (BRST)",
               (new Date(2014, 9, 19, 3, 59)).toString());
  assertEquals("Sun, 19 Oct 2014 05:59:00 GMT",
               (new Date(2014, 9, 19, 3, 59)).toUTCString());
  assertEquals("Sun Oct 19 2014 04:00:00 GMT-0200 (BRST)",
               (new Date(2014, 9, 19, 4, 0)).toString());
  assertEquals("Sun, 19 Oct 2014 06:00:00 GMT",
               (new Date(2014, 9, 19, 4, 0)).toUTCString());
  assertEquals("Sat Feb 15 2014 22:59:00 GMT-0200 (BRST)",
               (new Date(2014, 1, 15, 22, 59)).toString());
  assertEquals("Sun, 16 Feb 2014 00:59:00 GMT",
               (new Date(2014, 1, 15, 22, 59)).toUTCString());
  assertEquals("Sat Feb 15 2014 23:00:00 GMT-0200 (BRST)",
               (new Date(2014, 1, 15, 23, 0)).toString());
  assertEquals("Sun, 16 Feb 2014 01:00:00 GMT",
               (new Date(2014, 1, 15, 23, 0)).toUTCString());
  assertEquals("Sat Feb 15 2014 23:59:00 GMT-0200 (BRST)",
               (new Date(2014, 1, 15, 23, 59)).toString());
  assertEquals("Sun, 16 Feb 2014 01:59:00 GMT",
               (new Date(2014, 1, 15, 23, 59)).toUTCString());
  assertEquals("Sun Feb 16 2014 00:00:00 GMT-0300 (BRT)",
               (new Date(2014, 1, 16, 0, 0)).toString());
  assertEquals("Sun, 16 Feb 2014 03:00:00 GMT",
               (new Date(2014, 1, 16, 0, 0)).toUTCString());
  assertEquals("Sun Feb 16 2014 00:59:00 GMT-0300 (BRT)",
               (new Date(2014, 1, 16, 0, 59)).toString());
  assertEquals("Sun, 16 Feb 2014 03:59:00 GMT",
               (new Date(2014, 1, 16, 0, 59)).toUTCString());
  assertEquals("Sun Feb 16 2014 01:00:00 GMT-0300 (BRT)",
               (new Date(2014, 1, 16, 1, 0)).toString());
  assertEquals("Sun, 16 Feb 2014 04:00:00 GMT",
               (new Date(2014, 1, 16, 1, 0)).toUTCString());
  assertEquals("Sun Feb 16 2014 01:59:00 GMT-0300 (BRT)",
               (new Date(2014, 1, 16, 1, 59)).toString());
  assertEquals("Sun, 16 Feb 2014 04:59:00 GMT",
               (new Date(2014, 1, 16, 1, 59)).toUTCString());
  assertEquals("Sun Feb 16 2014 02:00:00 GMT-0300 (BRT)",
               (new Date(2014, 1, 16, 2, 0)).toString());
  assertEquals("Sun, 16 Feb 2014 05:00:00 GMT",
               (new Date(2014, 1, 16, 2, 0)).toUTCString());
  assertEquals("Sun Feb 16 2014 02:59:00 GMT-0300 (BRT)",
               (new Date(2014, 1, 16, 2, 59)).toString());
  assertEquals("Sun, 16 Feb 2014 05:59:00 GMT",
               (new Date(2014, 1, 16, 2, 59)).toUTCString());
  assertEquals("Sun Feb 16 2014 03:00:00 GMT-0300 (BRT)",
               (new Date(2014, 1, 16, 3, 0)).toString());
  assertEquals("Sun, 16 Feb 2014 06:00:00 GMT",
               (new Date(2014, 1, 16, 3, 0)).toUTCString());
  assertEquals("Sun Feb 16 2014 03:59:00 GMT-0300 (BRT)",
               (new Date(2014, 1, 16, 3, 59)).toString());
  assertEquals("Sun, 16 Feb 2014 06:59:00 GMT",
               (new Date(2014, 1, 16, 3, 59)).toUTCString());
  assertEquals("Sun Feb 16 2014 04:00:00 GMT-0300 (BRT)",
               (new Date(2014, 1, 16, 4, 0)).toString());
  assertEquals("Sun, 16 Feb 2014 07:00:00 GMT",
               (new Date(2014, 1, 16, 4, 0)).toUTCString());
}
if (timezone("PST")) {
  assertEquals("Sat Mar 08 2014 22:59:00 GMT-0800 (PST)",
               (new Date(2014, 2, 8, 22, 59)).toString());
  assertEquals("Sun, 09 Mar 2014 06:59:00 GMT",
               (new Date(2014, 2, 8, 22, 59)).toUTCString());
  assertEquals("Sat Mar 08 2014 23:00:00 GMT-0800 (PST)",
               (new Date(2014, 2, 8, 23, 0)).toString());
  assertEquals("Sun, 09 Mar 2014 07:00:00 GMT",
               (new Date(2014, 2, 8, 23, 0)).toUTCString());
  assertEquals("Sat Mar 08 2014 23:59:00 GMT-0800 (PST)",
               (new Date(2014, 2, 8, 23, 59)).toString());
  assertEquals("Sun, 09 Mar 2014 07:59:00 GMT",
               (new Date(2014, 2, 8, 23, 59)).toUTCString());
  assertEquals("Sun Mar 09 2014 00:00:00 GMT-0800 (PST)",
               (new Date(2014, 2, 9, 0, 0)).toString());
  assertEquals("Sun, 09 Mar 2014 08:00:00 GMT",
               (new Date(2014, 2, 9, 0, 0)).toUTCString());
  assertEquals("Sun Mar 09 2014 00:59:00 GMT-0800 (PST)",
               (new Date(2014, 2, 9, 0, 59)).toString());
  assertEquals("Sun, 09 Mar 2014 08:59:00 GMT",
               (new Date(2014, 2, 9, 0, 59)).toUTCString());
  assertEquals("Sun Mar 09 2014 01:00:00 GMT-0800 (PST)",
               (new Date(2014, 2, 9, 1, 0)).toString());
  assertEquals("Sun, 09 Mar 2014 09:00:00 GMT",
               (new Date(2014, 2, 9, 1, 0)).toUTCString());
  assertEquals("Sun Mar 09 2014 01:59:00 GMT-0800 (PST)",
               (new Date(2014, 2, 9, 1, 59)).toString());
  assertEquals("Sun, 09 Mar 2014 09:59:00 GMT",
               (new Date(2014, 2, 9, 1, 59)).toUTCString());
  assertEquals("Sun Mar 09 2014 03:00:00 GMT-0700 (PDT)",
               (new Date(2014, 2, 9, 2, 0)).toString());
  assertEquals("Sun, 09 Mar 2014 10:00:00 GMT",
               (new Date(2014, 2, 9, 2, 0)).toUTCString());
  assertEquals("Sun Mar 09 2014 03:59:00 GMT-0700 (PDT)",
               (new Date(2014, 2, 9, 2, 59)).toString());
  assertEquals("Sun, 09 Mar 2014 10:59:00 GMT",
               (new Date(2014, 2, 9, 2, 59)).toUTCString());
  assertEquals("Sun Mar 09 2014 03:00:00 GMT-0700 (PDT)",
               (new Date(2014, 2, 9, 3, 0)).toString());
  assertEquals("Sun, 09 Mar 2014 10:00:00 GMT",
               (new Date(2014, 2, 9, 3, 0)).toUTCString());
  assertEquals("Sun Mar 09 2014 03:59:00 GMT-0700 (PDT)",
               (new Date(2014, 2, 9, 3, 59)).toString());
  assertEquals("Sun, 09 Mar 2014 10:59:00 GMT",
               (new Date(2014, 2, 9, 3, 59)).toUTCString());
  assertEquals("Sun Mar 09 2014 04:00:00 GMT-0700 (PDT)",
               (new Date(2014, 2, 9, 4, 0)).toString());
  assertEquals("Sun, 09 Mar 2014 11:00:00 GMT",
               (new Date(2014, 2, 9, 4, 0)).toUTCString());
  assertEquals("Sat Nov 01 2014 22:59:00 GMT-0700 (PDT)",
               (new Date(2014, 10, 1, 22, 59)).toString());
  assertEquals("Sun, 02 Nov 2014 05:59:00 GMT",
               (new Date(2014, 10, 1, 22, 59)).toUTCString());
  assertEquals("Sat Nov 01 2014 23:00:00 GMT-0700 (PDT)",
               (new Date(2014, 10, 1, 23, 0)).toString());
  assertEquals("Sun, 02 Nov 2014 06:00:00 GMT",
               (new Date(2014, 10, 1, 23, 0)).toUTCString());
  assertEquals("Sat Nov 01 2014 23:59:00 GMT-0700 (PDT)",
               (new Date(2014, 10, 1, 23, 59)).toString());
  assertEquals("Sun, 02 Nov 2014 06:59:00 GMT",
               (new Date(2014, 10, 1, 23, 59)).toUTCString());
  assertEquals("Sun Nov 02 2014 00:00:00 GMT-0700 (PDT)",
               (new Date(2014, 10, 2, 0, 0)).toString());
  assertEquals("Sun, 02 Nov 2014 07:00:00 GMT",
               (new Date(2014, 10, 2, 0, 0)).toUTCString());
  assertEquals("Sun Nov 02 2014 00:59:00 GMT-0700 (PDT)",
               (new Date(2014, 10, 2, 0, 59)).toString());
  assertEquals("Sun, 02 Nov 2014 07:59:00 GMT",
               (new Date(2014, 10, 2, 0, 59)).toUTCString());
  assertEquals("Sun Nov 02 2014 01:00:00 GMT-0700 (PDT)",
               (new Date(2014, 10, 2, 1, 0)).toString());
  assertEquals("Sun, 02 Nov 2014 08:00:00 GMT",
               (new Date(2014, 10, 2, 1, 0)).toUTCString());
  assertEquals("Sun Nov 02 2014 01:59:00 GMT-0700 (PDT)",
               (new Date(2014, 10, 2, 1, 59)).toString());
  assertEquals("Sun, 02 Nov 2014 08:59:00 GMT",
               (new Date(2014, 10, 2, 1, 59)).toUTCString());
  assertEquals("Sun Nov 02 2014 02:00:00 GMT-0800 (PST)",
               (new Date(2014, 10, 2, 2, 0)).toString());
  assertEquals("Sun, 02 Nov 2014 10:00:00 GMT",
               (new Date(2014, 10, 2, 2, 0)).toUTCString());
  assertEquals("Sun Nov 02 2014 02:59:00 GMT-0800 (PST)",
               (new Date(2014, 10, 2, 2, 59)).toString());
  assertEquals("Sun, 02 Nov 2014 10:59:00 GMT",
               (new Date(2014, 10, 2, 2, 59)).toUTCString());
  assertEquals("Sun Nov 02 2014 03:00:00 GMT-0800 (PST)",
               (new Date(2014, 10, 2, 3, 0)).toString());
  assertEquals("Sun, 02 Nov 2014 11:00:00 GMT",
               (new Date(2014, 10, 2, 3, 0)).toUTCString());
  assertEquals("Sun Nov 02 2014 03:59:00 GMT-0800 (PST)",
               (new Date(2014, 10, 2, 3, 59)).toString());
  assertEquals("Sun, 02 Nov 2014 11:59:00 GMT",
               (new Date(2014, 10, 2, 3, 59)).toUTCString());
  assertEquals("Sun Nov 02 2014 04:00:00 GMT-0800 (PST)",
               (new Date(2014, 10, 2, 4, 0)).toString());
  assertEquals("Sun, 02 Nov 2014 12:00:00 GMT",
               (new Date(2014, 10, 2, 4, 0)).toUTCString());
}

Reply via email to