Time.convert

You're seeing just the function convert, go back to Time module for more information.
Link to this function

convert(time, calendar)

View Source (since 1.5.0)

Specs

convert(Calendar.time(), Calendar.calendar()) :: {:ok, t()} | {:error, atom()}

Converts given time to a different calendar.

Returns {:ok, time} if the conversion was successful, or {:error, reason} if it was not, for some reason.

Examples

Imagine someone implements Calendar.Holocene, a calendar based on the Gregorian calendar that adds exactly 10,000 years to the current Gregorian year:

iex> Time.convert(~T[13:30:15], Calendar.Holocene)
{:ok, %Time{calendar: Calendar.Holocene, hour: 13, minute: 30, second: 15, microsecond: {0, 0}}}