{"action":"created","issue":{"url":"https://api.github.com/repos/brianc/node-pg-types/issues/50","repository_url":"https://api.github.com/repos/brianc/node-pg-types","labels_url":"https://api.github.com/repos/brianc/node-pg-types/issues/50/labels{/name}","comments_url":"https://api.github.com/repos/brianc/node-pg-types/issues/50/comments","events_url":"https://api.github.com/repos/brianc/node-pg-types/issues/50/events","html_url":"https://github.com/brianc/node-pg-types/issues/50","id":173480615,"number":50,"title":"Do not return DATE fields as Javascript Date","user":{"login":"felixfbecker","id":10532611,"avatar_url":"https://avatars.githubusercontent.com/u/10532611?v=3","gravatar_id":"","url":"https://api.github.com/users/felixfbecker","html_url":"https://github.com/felixfbecker","followers_url":"https://api.github.com/users/felixfbecker/followers","following_url":"https://api.github.com/users/felixfbecker/following{/other_user}","gists_url":"https://api.github.com/users/felixfbecker/gists{/gist_id}","starred_url":"https://api.github.com/users/felixfbecker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felixfbecker/subscriptions","organizations_url":"https://api.github.com/users/felixfbecker/orgs","repos_url":"https://api.github.com/users/felixfbecker/repos","events_url":"https://api.github.com/users/felixfbecker/events{/privacy}","received_events_url":"https://api.github.com/users/felixfbecker/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/brianc/node-pg-types/milestones/1","html_url":"https://github.com/brianc/node-pg-types/milestones/7.0","labels_url":"https://api.github.com/repos/brianc/node-pg-types/milestones/1/labels","id":1965473,"number":1,"title":"7.0","description":null,"creator":{"login":"brianc","id":50081,"avatar_url":"https://avatars.githubusercontent.com/u/50081?v=3","gravatar_id":"","url":"https://api.github.com/users/brianc","html_url":"https://github.com/brianc","followers_url":"https://api.github.com/users/brianc/followers","following_url":"https://api.github.com/users/brianc/following{/other_user}","gists_url":"https://api.github.com/users/brianc/gists{/gist_id}","starred_url":"https://api.github.com/users/brianc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brianc/subscriptions","organizations_url":"https://api.github.com/users/brianc/orgs","repos_url":"https://api.github.com/users/brianc/repos","events_url":"https://api.github.com/users/brianc/events{/privacy}","received_events_url":"https://api.github.com/users/brianc/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2016-08-26T15:35:12Z","updated_at":"2016-08-26T15:35:13Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2016-08-26T15:30:22Z","updated_at":"2016-08-26T15:44:53Z","closed_at":null,"body":"A Javascript `Date` is always parsed in local timezone. A DATE column in Postgres or any other DB doesn't have any timezone associated with it, it is just a date. It begins and ends differently depending on where you are. Parsing this as a JS `Date` that has timezone associated with it is a huge problem. Let's say your server is located in GMT+2 (Germany). You insert a date into your database, like `2016-08-26`. When you query that in Germany, you will get the `Date` object `Fri Aug 26 2016 00:00:00 GMT+0200`. But run `toUTCString()` on it, and you get `Thu, 25 Aug 2016 22:00:00 GMT`! The date is one day off. This imposes a huge problem for distributed applications.\r\n\r\n**TL;DR** JavaScript objects are _not_ suited to represent a DATE field, because they have a timezone and time associated, while a DATE has not.\r\n\r\n`postgres-date` should not be used to parse it and instead, the string should be returned (just like with a DECIMAL). Users can register their own type parser with their own `DateOnly` object if they want.\r\n\r\nThis will be a breaking change and we would like to depend on this in Sequelize 4.\r\n\r\nSee https://github.com/sequelize/sequelize/issues/4858"},"comment":{"url":"https://api.github.com/repos/brianc/node-pg-types/issues/comments/242772117","html_url":"https://github.com/brianc/node-pg-types/issues/50#issuecomment-242772117","issue_url":"https://api.github.com/repos/brianc/node-pg-types/issues/50","id":242772117,"user":{"login":"brianc","id":50081,"avatar_url":"https://avatars.githubusercontent.com/u/50081?v=3","gravatar_id":"","url":"https://api.github.com/users/brianc","html_url":"https://github.com/brianc","followers_url":"https://api.github.com/users/brianc/followers","following_url":"https://api.github.com/users/brianc/following{/other_user}","gists_url":"https://api.github.com/users/brianc/gists{/gist_id}","starred_url":"https://api.github.com/users/brianc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brianc/subscriptions","organizations_url":"https://api.github.com/users/brianc/orgs","repos_url":"https://api.github.com/users/brianc/repos","events_url":"https://api.github.com/users/brianc/events{/privacy}","received_events_url":"https://api.github.com/users/brianc/received_events","type":"User","site_admin":false},"created_at":"2016-08-26T15:44:53Z","updated_at":"2016-08-26T15:44:53Z","body":"Sorry was doing a bunch of node-postgres issues this morning. I'll delete the milestone & clean up the comments a bit - I'm only 1 of the maintainers here & my opinion is only 1 of several so we'll see what others weigh in on."}}
{"actor":{"display_login":"brianc"}}