{"action":"created","issue":{"url":"https://api.github.com/repos/sgrif/diesel/issues/94","labels_url":"https://api.github.com/repos/sgrif/diesel/issues/94/labels{/name}","comments_url":"https://api.github.com/repos/sgrif/diesel/issues/94/comments","events_url":"https://api.github.com/repos/sgrif/diesel/issues/94/events","html_url":"https://github.com/sgrif/diesel/pull/94","id":126552082,"number":94,"title":"[WIP] Add support for `chrono` types","user":{"login":"tohou","id":13155277,"avatar_url":"https://avatars.githubusercontent.com/u/13155277?v=3","gravatar_id":"","url":"https://api.github.com/users/tohou","html_url":"https://github.com/tohou","followers_url":"https://api.github.com/users/tohou/followers","following_url":"https://api.github.com/users/tohou/following{/other_user}","gists_url":"https://api.github.com/users/tohou/gists{/gist_id}","starred_url":"https://api.github.com/users/tohou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tohou/subscriptions","organizations_url":"https://api.github.com/users/tohou/orgs","repos_url":"https://api.github.com/users/tohou/repos","events_url":"https://api.github.com/users/tohou/events{/privacy}","received_events_url":"https://api.github.com/users/tohou/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-14T00:57:14Z","updated_at":"2016-01-14T03:53:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/sgrif/diesel/pulls/94","html_url":"https://github.com/sgrif/diesel/pull/94","diff_url":"https://github.com/sgrif/diesel/pull/94.diff","patch_url":"https://github.com/sgrif/diesel/pull/94.patch"},"body":"As discussed in issue #92, I started writing `impl`s for diesel to handle chrono’s `DateTime` type. This is strongly inspired by the implementation of same feature in the postgres crate.\r\n\r\nOnly `DateTime` is handled at the moment. Tests are far from complete.\r\n\r\nI wonder if it would not be possible to implement `FromSql` and `ToSql` for `DateTime<T: TimeZone>` and avoid having to provide implementations for `UTC`, `FixedOffset` and `Local`. The whole timezones business is a bit fuzzy in my head as soon as it strays too far from “UTC everywhere”.\r\n\r\nI have a two questions:\r\n\r\n- Shouldn’t\r\n[this](https://github.com/sgrif/diesel/blob/master/diesel/src/types/impls/date_and_time/mod.rs#L17)\r\nread “Timestamps are represented in Postgres as a *64 bit* signed integer”? If so, should this be in a separate PR?\r\n- As converting from `DateTime` to `Date` (for example) is easy, should  there be impls like `impl ToSql<Date> for NaiveDateTime`, or should mappings between types be strict?"},"comment":{"url":"https://api.github.com/repos/sgrif/diesel/issues/comments/171521600","html_url":"https://github.com/sgrif/diesel/pull/94#issuecomment-171521600","issue_url":"https://api.github.com/repos/sgrif/diesel/issues/94","id":171521600,"user":{"login":"sgrif","id":1529387,"avatar_url":"https://avatars.githubusercontent.com/u/1529387?v=3","gravatar_id":"","url":"https://api.github.com/users/sgrif","html_url":"https://github.com/sgrif","followers_url":"https://api.github.com/users/sgrif/followers","following_url":"https://api.github.com/users/sgrif/following{/other_user}","gists_url":"https://api.github.com/users/sgrif/gists{/gist_id}","starred_url":"https://api.github.com/users/sgrif/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgrif/subscriptions","organizations_url":"https://api.github.com/users/sgrif/orgs","repos_url":"https://api.github.com/users/sgrif/repos","events_url":"https://api.github.com/users/sgrif/events{/privacy}","received_events_url":"https://api.github.com/users/sgrif/received_events","type":"User","site_admin":false},"created_at":"2016-01-14T03:53:11Z","updated_at":"2016-01-14T03:53:11Z","body":"This is a great start, thanks for working on it."}}