{ "id": "120660", "key": "TIMOB-15413", "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": [ { "id": "15711", "description": "2013 Sprint 24", "name": "2013 Sprint 24", "archived": true, "released": true, "releaseDate": "2013-11-29" }, { "id": "15712", "description": "2013 Sprint 24 API", "name": "2013 Sprint 24 API", "archived": true, "released": true, "releaseDate": "2013-11-29" } ], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2013-11-11T17:35:27.000+0000", "created": "2013-10-01T04:45:08.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "ipass1" ], "versions": [ { "id": "15593", "description": "Release 3.1.3", "name": "Release 3.1.3", "archived": true, "released": true, "releaseDate": "2013-09-18" } ], "issuelinks": [], "assignee": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-28T20:20:36.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "{code:javascript}\r\nTi.API.log(new Date(1380589200000));\r\nTi.API.log(new Date(1380589200000).getHours());\r\n{code}\r\n\r\n*OUTPUT:*\r\n2013-10-01 01:00:00 +0000 // WRONG\r\n3 // RIGHT\r\n\r\nThe right date is: 2013-10-01 03:00:00 +0000, you can test it in browser's console or http://www.ruddwire.com/handy-code/date-to-millisecond-calculators\r\n\r\n// I have no idea how it is possible ,but now it shows two hours instead three.", "attachment": [], "flagged": false, "summary": "iOS: Logging date to console shifts time by several hours", "creator": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Tested on iOS & Ti: 3.1.2.GA", "comment": { "comments": [ { "id": "273936", "author": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Please can somebody have a look on this issue? Thanks", "updateAuthor": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-05T16:48:00.000+0000", "updated": "2013-10-05T16:48:00.000+0000" }, { "id": "274150", "author": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Note: If I run log that contains some string + Date it return different format of date ,but it is right!\r\n\r\n{code:javascript}\r\nTi.API.log(new Date(1380589200000));\r\nTi.API.log(\"-> \"+new Date(1380589200000));\r\n{code}\r\n\r\n*OUTPUT:*\r\n[INFO] : 2013-10-01 01:00:00 +0000\r\n[INFO] : -> Tue Oct 01 2013 02:00:00 GMT+0100 (BST)\r\n", "updateAuthor": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-08T11:54:31.000+0000", "updated": "2013-10-08T11:54:31.000+0000" }, { "id": "278014", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Hi Matej,\n\nThe result of both logs are identical, the difference is that the first log outputs it in the NSDate string format and the second in the .toString() format of the JS Date object.\n\nIf you log the JS Date object a native NSDate object is created and the string representation gets logged: \"2013-10-01 01:00:00 +0000\"\n\nIf you add a string to the date (\"->\" + new Date()) it will output the \"toString()\" version of the JS date. This is because the JS Engine converts it to a string at runtime and the native code reads it as a string, not a date.", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-11-04T19:25:18.000+0000", "updated": "2013-11-04T19:25:18.000+0000" }, { "id": "278115", "author": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-05T01:01:08.000+0000", "updated": "2013-11-05T01:02:24.000+0000" }, { "id": "278941", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Resolving issue as invalid", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-11-11T17:35:27.000+0000", "updated": "2013-11-11T17:35:27.000+0000" }, { "id": "416031", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-03-28T20:20:36.000+0000", "updated": "2017-03-28T20:20:36.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }