Getting the current date and or time in Elixir

Graham Conzett picture Graham Conzett · Feb 18, 2015 · Viewed 47.2k times · Source

This seems like a really dumb question but how does one get and display the current date or time in Elixir? I tried going through the docs but couldn't find anything. Do I need to use an Erlang function?

Answer

Jimmar picture Jimmar · Jul 25, 2016

You can use DateTime.utc_now/0 to get UTC DateTime.