Table of contents
TOC
Collapse the table of content
Expand the table of content

Duration.From

Owen Duncan|Last Updated: 4/19/2018

About

Returns a duration value from a value.

Duration.From(value as any) as nullable duration  

Arguments

ArgumentDescription
valueValue to convert.

Values of the following types can be converted to a duration value:

Type to ConvertDescription
textReturns a duration value from a text value in a elapsed time format of d.hⓂ️s. For more details, see Duration.FromText.
numberA duration equivalent to the number of whole and fractional days expressed by value.
Any other typeAn error is returned

Remarks

  • If a value is null, Duration.From returns null.

  • If a value is duration, the same value is returned.

Example

Duration.From(2.525) equals #duration(2,12,36,0)  
© 2018 Microsoft