Duration.From
Δημιουργεί μια διάρκεια από την τιμή που δόθηκε.
Syntax
Duration.From(
value as any
) as duration
Remarks
Returns a 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 toDuration.FromTextfor details.number: Adurationequivalent to the number of whole and fractional days expressed byvalue.
If value is of any other type, an error is returned.
Examples
Example #1
Μετατρέψτε την 2.525 σε μια τιμή duration.
Duration.From(2.525)
Result:
#duration(2, 12, 36, 0)
Example #2
Μετατρέψτε την τιμή κειμένου "2.05:55:20.34567" σε τιμή διάρκεια.
Duration.From("2.05:55:20.34567")
Result:
#duration(2, 5, 55, 20.3456700)
Category
Duration