{"action":"created","issue":{"url":"https://api.github.com/repos/es-shims/es5-shim/issues/329","labels_url":"https://api.github.com/repos/es-shims/es5-shim/issues/329/labels{/name}","comments_url":"https://api.github.com/repos/es-shims/es5-shim/issues/329/comments","events_url":"https://api.github.com/repos/es-shims/es5-shim/issues/329/events","html_url":"https://github.com/es-shims/es5-shim/issues/329","id":112104255,"number":329,"title":"Invalid Date due to implementation of toUTC method of shim in Safari 8 & 9","user":{"login":"ptacekj","id":2076077,"avatar_url":"https://avatars.githubusercontent.com/u/2076077?v=3","gravatar_id":"","url":"https://api.github.com/users/ptacekj","html_url":"https://github.com/ptacekj","followers_url":"https://api.github.com/users/ptacekj/followers","following_url":"https://api.github.com/users/ptacekj/following{/other_user}","gists_url":"https://api.github.com/users/ptacekj/gists{/gist_id}","starred_url":"https://api.github.com/users/ptacekj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ptacekj/subscriptions","organizations_url":"https://api.github.com/users/ptacekj/orgs","repos_url":"https://api.github.com/users/ptacekj/repos","events_url":"https://api.github.com/users/ptacekj/events{/privacy}","received_events_url":"https://api.github.com/users/ptacekj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-19T09:12:57Z","updated_at":"2015-10-19T09:57:02Z","closed_at":null,"body":"It seem that Safari treats `milliseconds` parameter of `new Date(year, month, day, hours, minutes, seconds, milliseconds)` as an signed integer which causes `toUTC` method to return Invalid Date for otherwise valid timestamps see http://prntscr.com/8svrxd check bellow \r\n```\r\nnew Date(1970, 0, 1,0, 0, 0, 2147483647); // 1970-01-25T19:31:23.647Z\r\nnew Date(1970, 0, 1,0, 0, 0, 2147483648); // Invalid Date\r\nnew Date(2147483647); // 1970-01-25T19:31:23.647Z\r\nnew Date(2147483648); // 1970-01-25T19:31:23.648Z\r\n```\r\n\r\nReal life example\r\n```\r\nnew Date('2015-07-01T00:00:00'); // Invalid Date in Safari 8 & 9, parseShim calls toUTC(1435708800000)\r\n```\r\n\r\nMy suggest would be to use `new NativeDate(t)` on https://github.com/es-shims/es5-shim/blob/master/es5-shim.js#L1148 unless there is some other compatibility reason not to do so. This solution works at least for this issue."},"comment":{"url":"https://api.github.com/repos/es-shims/es5-shim/issues/comments/149171196","html_url":"https://github.com/es-shims/es5-shim/issues/329#issuecomment-149171196","issue_url":"https://api.github.com/repos/es-shims/es5-shim/issues/329","id":149171196,"user":{"login":"ljharb","id":45469,"avatar_url":"https://avatars.githubusercontent.com/u/45469?v=3","gravatar_id":"","url":"https://api.github.com/users/ljharb","html_url":"https://github.com/ljharb","followers_url":"https://api.github.com/users/ljharb/followers","following_url":"https://api.github.com/users/ljharb/following{/other_user}","gists_url":"https://api.github.com/users/ljharb/gists{/gist_id}","starred_url":"https://api.github.com/users/ljharb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ljharb/subscriptions","organizations_url":"https://api.github.com/users/ljharb/orgs","repos_url":"https://api.github.com/users/ljharb/repos","events_url":"https://api.github.com/users/ljharb/events{/privacy}","received_events_url":"https://api.github.com/users/ljharb/received_events","type":"User","site_admin":false},"created_at":"2015-10-19T09:57:02Z","updated_at":"2015-10-19T09:57:02Z","body":"@ptacekj Please file this on http://bugs.webkit.org as well! They can at least fix it for the next Safari :-)"}}