Timex.Time (timex v3.7.6) View Source
This module provides helper functions for working with Times
Link to this section Summary
Functions
Converts an hour between 0..24 to {1..12, :am/:pm}
Converts an hour between 1..12 in either am or pm, to value between 0..24
Link to this section Functions
Specs
to_12hour_clock(0..24) :: {1..12, :am | :pm}
Converts an hour between 0..24 to {1..12, :am/:pm}
Examples
iex> Timex.Time.to_12hour_clock(23)
{11, :pm}
Specs
to_24hour_clock(1..12, :am | :pm) :: 0..23
Converts an hour between 1..12 in either am or pm, to value between 0..24
Examples
iex> Timex.Time.to_24hour_clock(7, :pm)
19