Working with time: Difference between revisions
From ElixirBlocks
								
												
				No edit summary  | 
				No edit summary  | 
				||
| Line 7: | Line 7: | ||
To convert time into human readable form:  | To convert time into human readable form:  | ||
<syntaxhighlight>  | |||
d = DateTime.utc_now()  | d = DateTime.utc_now()  | ||
Calendar.strftime(d, "%y-%m-%d %I:%M:%S %p")  | Calendar.strftime(d, "%y-%m-%d %I:%M:%S %p")  | ||
</syntaxhighlight>  | |||
Revision as of 03:52, 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")