Working with time: Difference between revisions

From ElixirBlocks
Jump to: navigation, search
(Created page with " Get time: <syntaxhighlight> DateTime.utc_now() </syntaxhighlight>")
 
No edit summary
Line 4: Line 4:
DateTime.utc_now()
DateTime.utc_now()
</syntaxhighlight>
</syntaxhighlight>
To convert time into human readable form:
d = DateTime.utc_now()
Calendar.strftime(d, "%y-%m-%d %I:%M:%S %p")

Revision as of 03:51, 12 March 2023

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")