BitstylesPhoenix.Time.ui_time
You're seeing just the function
ui_time
, go back to BitstylesPhoenix.Time module for more information.
Renders dates & times in a manner readable and expressive for both humans and machines.
human_time
— the string you want your human visitors to see
machine_time
— the UTC-formatted datetime string, with timezone.
A time
iex> safe_to_string ui_time("15:17", "2020-11-10 14:17:32Z")
~s(<time datetime="2020-11-10 14:17:32Z" title="2020-11-10 14:17:32Z">15:17</time>)
A date
iex> safe_to_string ui_time("2020-11-18", "2020-11-18 14:23:14Z")
~s(<time datetime="2020-11-18 14:23:14Z" title="2020-11-18 14:23:14Z">2020-11-18</time>)