Last active
January 18, 2018 18:37
-
-
Save allanbatista/f164f16a989e0fabd0eff7769fb8ddfd to your computer and use it in GitHub Desktop.
Create a elixir datetime with timezone
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
defmodule DateTimeHelper do | |
def get_datetimezone_iso8601 do | |
Timex.now | |
|> Timex.format!("{ISO:Extended:Z}") | |
end | |
end | |
iex> DateTimeHelper.get_datetimezone_iso8601() | |
#=> "2018-01-18T15:31:05.153423Z" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment