Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Syntax
Duration.From(value as any) as nullable duration
About
Returns the duration value from the given value.
value: The value from which the duration is derived. If the givenvalueisnull, this function returnsnull. If the givenvalueis aduration,valueis returned. Values of the following types can be converted to adurationvalue:text: Adurationvalue from textual elapsed time forms (d.h:m:s). Refer to Duration.FromText for details.number: Adurationequivalent to the number of whole and fractional days expressed byvalue.
If value is of any other type, an error is returned.
Example 1
Convert 2.525 into a duration value.
Usage
Duration.From(2.525)
Output
#duration(2, 12, 36, 0)
Example 2
Convert the text value "2.05:55:20.34567" into a duration value.
Usage
Duration.From("2.05:55:20.34567")
Output
#duration(2, 5, 55, 20.3456700)