{"action":"created","issue":{"url":"https://api.github.com/repos/bitwalker/timex_ecto/issues/9","labels_url":"https://api.github.com/repos/bitwalker/timex_ecto/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/bitwalker/timex_ecto/issues/9/comments","events_url":"https://api.github.com/repos/bitwalker/timex_ecto/issues/9/events","html_url":"https://github.com/bitwalker/timex_ecto/issues/9","id":118962777,"number":9,"title":"Does not convert to UTC before storing","user":{"login":"mgwidmann","id":5035724,"avatar_url":"https://avatars.githubusercontent.com/u/5035724?v=3","gravatar_id":"","url":"https://api.github.com/users/mgwidmann","html_url":"https://github.com/mgwidmann","followers_url":"https://api.github.com/users/mgwidmann/followers","following_url":"https://api.github.com/users/mgwidmann/following{/other_user}","gists_url":"https://api.github.com/users/mgwidmann/gists{/gist_id}","starred_url":"https://api.github.com/users/mgwidmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgwidmann/subscriptions","organizations_url":"https://api.github.com/users/mgwidmann/orgs","repos_url":"https://api.github.com/users/mgwidmann/repos","events_url":"https://api.github.com/users/mgwidmann/events{/privacy}","received_events_url":"https://api.github.com/users/mgwidmann/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-26T03:04:54Z","updated_at":"2015-11-30T18:17:56Z","closed_at":"2015-11-27T17:24:58Z","body":"I'm noticing that dates going in as any other timezone other than UTC, come out as UTC but with the hours not adjusted. For example:\r\n\r\n```elixir\r\n# Current date is 11/26/2015 2:53:50 in UTC\r\n%MyApp.Model{\r\n my_date: %Timex.DateTime{calendar: :gregorian, day: 26, hour: 2,\r\n  minute: 53, month: 11, ms: 904.0, second: 50,\r\n  timezone: %Timex.TimezoneInfo{abbreviation: \"UTC\", from: :min,\r\n   full_name: \"UTC\", offset_std: 0, offset_utc: 0, until: :max}, year: 2015}\r\n  ...\r\n}\r\n\r\n# Update the time to a new date in another timezone\r\nMyApp.Model.changeset(model, %{my_date: Timex.Date.now |> Timex.Timezone.convert(\"America/New_York\")}) |> Repo.update\r\n\r\n# Returned object from above update as well as refetched object show the following:\r\n# Now in UTC time but hour and day are as if it were in New York timezone\r\n%MyApp.Model{\r\n my_date: %Timex.DateTime{calendar: :gregorian, day: 25, hour: 21,\r\n  minute: 54, month: 11, ms: 805.0, second: 43,\r\n  timezone: %Timex.TimezoneInfo{abbreviation: \"UTC\", from: :min,\r\n   full_name: \"UTC\", offset_std: 0, offset_utc: 0, until: :max}, year: 2015}\r\n}\r\n```\r\nThese two dates are actually within a minute of each other (53:50 vs 54:43) but show as if they are 5 hours apart (New York's difference, -5)\r\n\r\nFor now, to get things to work right, I have to convert it to UTC prior to putting into the changeset and that fixes my problem."},"comment":{"url":"https://api.github.com/repos/bitwalker/timex_ecto/issues/comments/160712051","html_url":"https://github.com/bitwalker/timex_ecto/issues/9#issuecomment-160712051","issue_url":"https://api.github.com/repos/bitwalker/timex_ecto/issues/9","id":160712051,"user":{"login":"mgwidmann","id":5035724,"avatar_url":"https://avatars.githubusercontent.com/u/5035724?v=3","gravatar_id":"","url":"https://api.github.com/users/mgwidmann","html_url":"https://github.com/mgwidmann","followers_url":"https://api.github.com/users/mgwidmann/followers","following_url":"https://api.github.com/users/mgwidmann/following{/other_user}","gists_url":"https://api.github.com/users/mgwidmann/gists{/gist_id}","starred_url":"https://api.github.com/users/mgwidmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgwidmann/subscriptions","organizations_url":"https://api.github.com/users/mgwidmann/orgs","repos_url":"https://api.github.com/users/mgwidmann/repos","events_url":"https://api.github.com/users/mgwidmann/events{/privacy}","received_events_url":"https://api.github.com/users/mgwidmann/received_events","type":"User","site_admin":false},"created_at":"2015-11-30T18:17:56Z","updated_at":"2015-11-30T18:17:56Z","body":"Can't `timex_ecto` recognize its a non-UTC timezone and convert it for us here: https://github.com/bitwalker/timex_ecto/blob/master/lib/types/datetime.ex#L26"}}