Duration
A span of time, such as 27 days, 4 hours, 12 minutes, and 3 seconds.
A Duration represents a difference from one point in time to another. The duration may be "negative" if the difference is from a later time to an earlier.
Properties
-
days(int) –The number of days in the duration.
-
hours(int) –The number of hours in the duration.
-
in_days(int) –Returns total duration in days.
-
in_hours(int) –Returns total duration in hours.
-
in_microseconds(int) –Returns total duration in microseconds.
-
in_milliseconds(int) –Returns total duration in milliseconds.
-
in_minutes(int) –Returns total duration in minutes.
-
in_seconds(int) –Returns total duration in seconds.
-
is_negative(bool) –Returns True if duration is negative.
-
microseconds(int) –The number of microseconds in the duration.
-
milliseconds(int) –The number of milliseconds in the duration.
-
minutes(int) –The number of minutes in the duration.
-
seconds(int) –The number of seconds in the duration.
Methods
-
abs–Returns absolute (non-negative) Duration.
-
copy–Returns a copy of this
Durationinstance with the given fields replaced -
from_unit–Creates a Duration from individual time units.