{ "id": "171148", "key": "TIMOB-25791", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2018-05-05T12:47:49.000+0000", "created": "2018-02-20T19:43:12.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [ { "id": "20060", "description": "", "name": "Release 7.0.2", "archived": false, "released": true, "releaseDate": "2018-02-09" } ], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-05-16T21:45:22.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "Hi,\r\nThere is an issue in the SDK 7.0.2 with the getTime() function in Android.\r\nIssue:-\r\nnew Date(\"2018-02-20T11:30:00\").getTime() has discrepancy with the old sdk's (\r\nsame function is returning different values(milliseconds) in old sdk and new sdk.\r\n1519104600000 - new sdk (7.0.2.GA)\r\n1519126200000 - old sdk (6.3.0.GA)\r\n\r\nsteps to recreate:-\r\n1)calculate the milliseconds using new Date(\"2018-02-20T11:30:00\").getTime() in 7.0.2 and 6.3.0.\r\n2)copy that in check the local time and UTC in http://currentmillis.com.\r\n3) you should see the difference in two SDK's.\r\n\r\nTest Code:\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor : '#fff'\r\n});\r\nvar sf=new Date(\"2018-02-20T11:30:00\").getTime();\r\nTi.API.info(sf);\r\nalert(sf);\r\nwin.open();\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": " Android: getTime issue with 7.0.2 sdk in android", "creator": { "name": "aislam", "key": "aislam", "displayName": "Aminul Islam", "active": false, "timeZone": "Etc/GMT-6" }, "subtasks": [], "reporter": { "name": "aislam", "key": "aislam", "displayName": "Aminul Islam", "active": false, "timeZone": "Etc/GMT-6" }, "environment": "Operating System\r\n Name = Mac OS X\r\n Version = 10.13\r\n Architecture = 64bit\r\n # CPUs = 4\r\n Memory = 8589934592\r\nNode.js\r\n Node.js Version = 8.9.1\r\n npm Version = 5.5.1\r\nTitanium CLI\r\n CLI Version = 5.0.14\r\nTitanium SDK\r\n SDK Version = 6.3.0.GA & 7.0.2.GA", "closedSprints": [ { "id": 1028, "state": "closed", "name": "2018 Sprint 09 SDK", "startDate": "2018-04-22T22:53:08.928Z", "endDate": "2018-05-06T22:53:00.000Z", "completeDate": "2018-05-07T00:02:15.883Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "434681", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is an intentional breaking change Google has made in their V8 JavaScript engine. Google has made this breaking change back in 2015.\r\nhttps://bugs.chromium.org/p/chromium/issues/detail?id=543320\r\n\r\nThe issue is that the V8 JavaScript {{Date}} constructor and {{parse()}} method will interpret \"YYYY-MM-DDTHH:MM:SS\" as local time instead of UTC/GMT time as of 2015. This change can be seen in Google's Chrome browser and in node.js (which uses V8). Titanium upgraded to a newer version of V8 on Android as of Titanium 7.0.0, which is why you're now seeing this breaking change.\r\n\r\nUnfortunately, Apple's JavaScripCore scripting engine does not have the same behavior and interprets that same datetime string as UTC, not local time. This difference can be seen in the Safari web browser. (It's a bummer I know.)\r\n\r\nNow, here's what you can do to make it work on all platforms. According to the ISO-8601 datetime spec, you are supposed to append a capital 'Z' to the end of this datetime string which tells the system to interpret it as UTC, not local time. I've tested this and it works on both Android and iOS.\r\nhttps://www.w3.org/TR/NOTE-datetime\r\n\r\nFor example, try this...\r\n{{\"2018-02-20T11:30:00Z\"}}\r\n\r\nNote that it must be a capital 'Z', not a lowercase 'z'. Apple does not support the lowercase form.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-02-20T23:41:54.000+0000", "updated": "2018-02-20T23:41:54.000+0000" }, { "id": "437407", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Resolving as per previous comments - it is nothing Titanium influences. In case the old behavior should be restored (it was during a major release which expects API's to change in behavior), guidance is given above.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-05-05T12:49:23.000+0000", "updated": "2018-05-05T12:49:23.000+0000" }, { "id": "437713", "author": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing as ticket was resolved (and not Titanium related)", "updateAuthor": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-05-16T21:45:22.000+0000", "updated": "2018-05-16T21:45:22.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }