xtd 0.2.0
Loading...
Searching...
No Matches

◆ from_minutes() [1/2]

static time_span xtd::time_span::from_minutes ( double  value)
static

Returns a xtd::time_span that represents a specified number of minutes, where the specification is accurate to the nearest millisecond.

Parameters
valueA number of minutes, accurate to the nearest millisecond.
Returns
An object that represents value.
Exceptions
xtd::overflow_exceptionvalue is less than xtd::time_span::min_value or greater than xtd::time_span::max_value.
-or-
value is xtd::double_object::positive_infinity.
-or-
value is xtd::double_object::negative_infinity.
xtd::argument_exceptionvalue is equal to xtd::double_object::NaN.
Remarks
The value parameter is converted to milliseconds, which is converted to ticks, and that number of ticks is used to initialize the new xtd::time_span. Therefore, value will only be considered accurate to the nearest millisecond. Note that, because of the loss of precision of the Double data type, this conversion can generate an xtd::overflow_exception for values that are near to but still in the range of either xtd::time_span::min_value or xtd::time_span::max_value. For example, this causes an xtd::overflow_exception in the following attempt to instantiate a xtd::time_span object.
// The following throws an overflow_exception at runtime
auto max_span = time_span::from_minutes(time_span::max_value::total_miminutes);
static time_span from_minutes(double value)
Returns a xtd::time_span that represents a specified number of minutes, where the specification is ac...