Last active
February 4, 2016 20:32
-
-
Save paulcsmith/718e8def09b4fb1ab525 to your computer and use it in GitHub Desktop.
Casting/Converting time zones
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"timestamp_with_timezone" | |
|> Timex.DateTime.parse("{ISO}") | |
|> Timex.DateConvert.to_erlang_datetime | |
# You probably don't need this next line for most things in Ecto. | |
# Changesets and queries automatically cast erlang timestamps | |
|> Ecto.DateTime.from_erl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment