{"action":"closed","issue":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/7522","repository_url":"https://api.github.com/repos/HaxeFoundation/haxe","labels_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/7522/labels{/name}","comments_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/7522/comments","events_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/7522/events","html_url":"https://github.com/HaxeFoundation/haxe/issues/7522","id":367341554,"node_id":"MDU6SXNzdWUzNjczNDE1NTQ=","number":7522,"title":"Date inconsistencies in hl and cpp targets","user":{"login":"thomasjwebb","id":16326686,"node_id":"MDQ6VXNlcjE2MzI2Njg2","avatar_url":"https://avatars1.githubusercontent.com/u/16326686?v=4","gravatar_id":"","url":"https://api.github.com/users/thomasjwebb","html_url":"https://github.com/thomasjwebb","followers_url":"https://api.github.com/users/thomasjwebb/followers","following_url":"https://api.github.com/users/thomasjwebb/following{/other_user}","gists_url":"https://api.github.com/users/thomasjwebb/gists{/gist_id}","starred_url":"https://api.github.com/users/thomasjwebb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomasjwebb/subscriptions","organizations_url":"https://api.github.com/users/thomasjwebb/orgs","repos_url":"https://api.github.com/users/thomasjwebb/repos","events_url":"https://api.github.com/users/thomasjwebb/events{/privacy}","received_events_url":"https://api.github.com/users/thomasjwebb/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-10-05T19:37:05Z","updated_at":"2018-10-06T06:49:24Z","closed_at":"2018-10-06T06:49:23Z","author_association":"NONE","body":"Date seems to be acting differently for me depending on the target. In the hl target, dates prior to the unix epoch are invalid:\r\n\r\n```\r\nvar date = new Date(1905, 0, 12, 1, 4, 1);\r\ntrace(date.getFullYear()); // throws Uncaught exception: invalid date`\r\n```\r\n\r\nDates prior to the unix epoch in the cpp target give me wrong values:\r\n\r\n```\r\nvar date = new Date(1905, 0, 12, 1, 4, 1);\r\ntrace(date.getFullYear()); // prints 1900, wrong\r\ntrace(date.getMonth()); // prints 0, right\r\ntrace(date.getHours()); // prints 0, wrong\r\n```\r\n\r\nHowever, dates after work correctly (both cpp and hl):\r\n\r\n```\r\nvar date = new Date(1975, 0, 12, 1, 4, 1);\r\ntrace(date.getFullYear()); // prints 1975, right\r\ntrace(date.getMonth()); // prints 0, right\r\ntrace(date.getHours()); // prints 1, right\r\n```\r\n\r\nIn js everything works correctly. I'm having some technical issues getting haxe 3 working on the specific machine I'm on and am too lazy to switch OSes or machines right this second (every other machine I have has lix working smoothly where I can switch between haxe versions seamlessly). I also already am using some haxe 4-spefic features so if haxe 3 works fine here, that's not of much help to me. But I am working off the assumption that this is a haxe 4 specific problem. Either that, or me doing something really wrong."}}
{"actor":{"display_login":"Simn"}}