Skip to content

Instantly share code, notes, and snippets.

@paulcsmith
Last active February 4, 2016 20:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulcsmith/718e8def09b4fb1ab525 to your computer and use it in GitHub Desktop.
Save paulcsmith/718e8def09b4fb1ab525 to your computer and use it in GitHub Desktop.
Casting/Converting time zones
"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