Time.From
Creates a time from the given value.
Syntax
Time.From(
value as any,
optional culture as text
) as time
Remarks
Returns a time
value from the given value
. An optional culture
may also be provided (for example, "en-US").If the given value
is null
, Time.From
returns null
. If the given value
is time
, value
is returned. Values of the following types can be converted to a time
value:
text
: Atime
value from textual representation. Refer toTime.FromText
for details.datetime
: The time component of thevalue
.datetimezone
: The time component of the local datetime equivalent ofvalue
.number
: Atime
equivalent to the number of fractional days expressed byvalue
. Ifvalue
is negative or greater or equal to 1, an error is returned.
value
is of any other type, an error is returned.
Examples
Example #1
Convert <code>0.7575</code> to a <code>time</code> value.
Time.From(0.7575)
Result:
#time(18, 10, 48)
Example #2
Convert <code>#datetime(1899, 12, 30, 06, 45, 12)</code> to a <code>time</code> value.
Time.From(#datetime(1899, 12, 30, 06, 45, 12))
Result:
#time(06, 45, 12)
Category
Time