{"action":"created","issue":{"url":"https://api.github.com/repos/elixir-lang/ecto/issues/1224","labels_url":"https://api.github.com/repos/elixir-lang/ecto/issues/1224/labels{/name}","comments_url":"https://api.github.com/repos/elixir-lang/ecto/issues/1224/comments","events_url":"https://api.github.com/repos/elixir-lang/ecto/issues/1224/events","html_url":"https://github.com/elixir-lang/ecto/issues/1224","id":129472091,"number":1224,"title":"Aggregate functions lose type information","user":{"login":"benwilson512","id":247817,"avatar_url":"https://avatars.githubusercontent.com/u/247817?v=3","gravatar_id":"","url":"https://api.github.com/users/benwilson512","html_url":"https://github.com/benwilson512","followers_url":"https://api.github.com/users/benwilson512/followers","following_url":"https://api.github.com/users/benwilson512/following{/other_user}","gists_url":"https://api.github.com/users/benwilson512/gists{/gist_id}","starred_url":"https://api.github.com/users/benwilson512/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benwilson512/subscriptions","organizations_url":"https://api.github.com/users/benwilson512/orgs","repos_url":"https://api.github.com/users/benwilson512/repos","events_url":"https://api.github.com/users/benwilson512/events{/privacy}","received_events_url":"https://api.github.com/users/benwilson512/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-28T14:45:08Z","updated_at":"2016-01-28T14:54:20Z","closed_at":null,"body":"Hey!\r\n\r\nSuppose I have a Reading schema with a field\r\n\r\n```\r\nfield :recorded_at, Timex.Ecto.DateTime\r\n```\r\n\r\nIf I run this query:\r\n```\r\nReading\r\n|> select([r], r.recorded_at)\r\n|> Repo.all \r\n```\r\nI get back the `Timex.Date`  structs I expect. If however I want to find the maximum recorded_at value and thus run\r\n```\r\nReading\r\n|> select([r], max(r.recorded_at))\r\n|> Repo.all\r\n```\r\n\r\nNow I get back `{{2016, 2, 8}, {1, 10, 29, 0}}` style datetimes.\r\n\r\nIs this intended behaviour?\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/elixir-lang/ecto/issues/comments/176223840","html_url":"https://github.com/elixir-lang/ecto/issues/1224#issuecomment-176223840","issue_url":"https://api.github.com/repos/elixir-lang/ecto/issues/1224","id":176223840,"user":{"login":"josevalim","id":9582,"avatar_url":"https://avatars.githubusercontent.com/u/9582?v=3","gravatar_id":"","url":"https://api.github.com/users/josevalim","html_url":"https://github.com/josevalim","followers_url":"https://api.github.com/users/josevalim/followers","following_url":"https://api.github.com/users/josevalim/following{/other_user}","gists_url":"https://api.github.com/users/josevalim/gists{/gist_id}","starred_url":"https://api.github.com/users/josevalim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josevalim/subscriptions","organizations_url":"https://api.github.com/users/josevalim/orgs","repos_url":"https://api.github.com/users/josevalim/repos","events_url":"https://api.github.com/users/josevalim/events{/privacy}","received_events_url":"https://api.github.com/users/josevalim/received_events","type":"User","site_admin":false},"created_at":"2016-01-28T14:54:20Z","updated_at":"2016-01-28T14:54:20Z","body":"Nope, bug. Thank you!"}}