Working with time

From ElixirBlocks
Revision as of 04:05, 12 March 2023 by Admin (talk | contribs)
Jump to: navigation, search

Get time:

DateTime.utc_now()


To convert time into human readable form:

d = DateTime.utc_now()
Calendar.strftime(d, "%y-%m-%d %I:%M:%S %p")


Timezone data

Elixir does not have built in support for timezone data. You need to use this module:

https://github.com/lau/tzdata