Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18047] Titanium JS engine does not handle russian winter time shift 25.oct 2014 properly

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-12-04T16:53:23.000+0000
Affected Version/sn/a
Fix Version/sRelease 3.5.0, Release 4.0.0
Componentsn/a
Labelsn/a
ReporterYury Skaletskiy
AssigneeIngo Muschenetz
Created2014-11-07T11:43:42.000+0000
Updated2015-01-07T02:27:43.000+0000

Description

JS Date.setDate() looses a day when it is using for dates beyond to oct 25. For instance, there's a log from my IOS simulator (OSX Yosemite, Moscow Standard Time, time is taken from NTP server by OSX). code: var date2 = new Date(2014,09,25,5,01,01); // 25 october Ti.API.info(" date2-1 ", date2, "day",date2.getDate(), "ts", date2.getTime()); log output: [INFO] : date2-1 2014-10-25 01:01:01 +0000 day 25 ts 1414198861000 // ok now, oct 25. UTC time shift is 4 hrs date2 = new Date(2014,09,26,5,01,01); Ti.API.info(" date2-2 ", date2, "day",date2.getDate(), "ts", date2.getTime()); [INFO] : date2-2 2014-10-25 02:01:01 +0000 day 25 ts 1414202461000 // THIS IS WRONG! still 25 october, UTC time shift is 24+3 hours! I see the same picture on devices, too

Comments

  1. Shuo Liang 2014-11-18

  2. Vishal Duggal 2014-12-04

    This has been fixed with the TiCore update
  3. Ewan Harris 2015-01-07

    Verified fix on: Mac OSX 10.10.1 Appcelerator Studio, build: 3.4.1.201410281743 Titanium SDK build: 3.5.0.v20150106102524 Titanium CLI, build: 3.4.1 Alloy: 1.5.1 Xcode 6.1.1 iPhone 6 Plus (8.1), iPhone 4s Simulator (8.1)
       var date2 = new Date(2014,09,26,5,01,01);
       Ti.API.info(" date2-2 ", date2, "day",date2.getDate(), "ts", date2.getTime());
       
    When using the above code the console output is now *date2-2 2014-10-26 02:01:01 +0000 day 26 ts 1414288861000*, as expected. Closing ticket.

JSON Source