ostk.physics.time.Duration

class Duration(self: ostk.physics.time.Duration, arg0: datetime.timedelta)

Bases: pybind11_object

Duration format.

Constructor. :param count: A nanosecond count. :type count: int

Methods

between

Constructs a duration between two instants

days

Create a duration in days.

get_absolute

Get the absolute duration.

get_days

Get the day count.

get_hours

Get the hour count.

get_microseconds

Get the microsecond count.

get_milliseconds

Get the millisecond count.

get_minutes

Get the minute count.

get_nanoseconds

Get the nanosecond count.

get_seconds

Get the second count.

get_weeks

Get the week count.

hours

Create a duration in hours.

in_days

Get the duration in days.

in_hours

Get the duration in hours.

in_microseconds

Get the duration in microseconds.

in_milliseconds

Get the duration in milliseconds.

in_minutes

Get the duration in minutes.

in_nanoseconds

Get the duration in nanoseconds.

in_seconds

Get the duration in seconds.

in_unit

Get the duration in a unit.

in_weeks

Get the duration in weeks.

is_defined

Check if the duration is defined.

is_near

Check if the duration is near another duration.

is_positive

Check if the duration is positive.

is_strictly_positive

Check if the duration is strictly positive.

is_zero

Check if the duration is zero.

microseconds

Create a duration in microseconds.

milliseconds

Create a duration in milliseconds.

minutes

Create a duration in minutes.

nanoseconds

Create a duration in nanoseconds.

parse

seconds

Create a duration in seconds.

to_string

Overloaded function.

to_timedelta

undefined

Create an undefined duration.

weeks

Create a duration in weeks.

zero

Create a zero duration.

class Format(self: ostk.physics.time.Duration.Format, value: int)

Bases: pybind11_object

Members:

Undefined :

Undefined format.

Standard :

Standard format (d hh:mm:ss.mmm.uuu.nnn)

ISO8601 :

ISO 8601 format (PnDTnHnMnS)

property name
__add__(
self: ostk.physics.time.Duration,
arg0: ostk.physics.time.Duration,
) ostk.physics.time.Duration
__mul__(
self: ostk.physics.time.Duration,
arg0: float,
) ostk.physics.time.Duration
static between(
arg0: ostk::physics::time::Instant,
arg1: ostk::physics::time::Instant,
) ostk.physics.time.Duration

Constructs a duration between two instants

Returns:

Duration between two instants.

Return type:

Duration

static days(arg0: ostk.core.type.Real) ostk.physics.time.Duration

Create a duration in days.

Returns:

Duration in days.

Return type:

Duration

get_absolute(self: ostk.physics.time.Duration) ostk.physics.time.Duration

Get the absolute duration.

Returns:

Absolute duration.

Return type:

Duration

get_days(self: ostk.physics.time.Duration) ostk.core.type.Integer

Get the day count.

Returns:

Day count.

Return type:

int

get_hours(self: ostk.physics.time.Duration) ostk.core.type.Integer

Get the hour count.

Returns:

Hour count.

Return type:

int

get_microseconds(self: ostk.physics.time.Duration) ostk.core.type.Integer

Get the microsecond count.

Returns:

Microsecond count.

Return type:

int

get_milliseconds(self: ostk.physics.time.Duration) ostk.core.type.Integer

Get the millisecond count.

Returns:

Millisecond count.

Return type:

int

get_minutes(self: ostk.physics.time.Duration) ostk.core.type.Integer

Get the minute count.

Returns:

Minute count.

Return type:

int

get_nanoseconds(self: ostk.physics.time.Duration) ostk.core.type.Integer

Get the nanosecond count.

Returns:

Nanosecond count.

Return type:

int

get_seconds(self: ostk.physics.time.Duration) ostk.core.type.Integer

Get the second count.

Returns:

Second count.

Return type:

int

get_weeks(self: ostk.physics.time.Duration) ostk.core.type.Integer

Get the week count.

Returns:

Week count.

Return type:

int

static hours(arg0: ostk.core.type.Real) ostk.physics.time.Duration

Create a duration in hours.

Returns:

Duration in hours.

Return type:

Duration

in_days(self: ostk.physics.time.Duration) ostk.core.type.Real

Get the duration in days.

Returns:

Duration in days.

Return type:

float

in_hours(self: ostk.physics.time.Duration) ostk.core.type.Real

Get the duration in hours.

Returns:

Duration in hours.

Return type:

float

in_microseconds(self: ostk.physics.time.Duration) ostk.core.type.Real

Get the duration in microseconds.

Returns:

Duration in microseconds.

Return type:

float

in_milliseconds(self: ostk.physics.time.Duration) ostk.core.type.Real

Get the duration in milliseconds.

Returns:

Duration in milliseconds.

Return type:

float

in_minutes(self: ostk.physics.time.Duration) ostk.core.type.Real

Get the duration in minutes.

Returns:

Duration in minutes.

Return type:

float

in_nanoseconds(self: ostk.physics.time.Duration) ostk.core.type.Real

Get the duration in nanoseconds.

Returns:

Duration in nanoseconds.

Return type:

float

in_seconds(self: ostk.physics.time.Duration) ostk.core.type.Real

Get the duration in seconds.

Returns:

Duration in seconds.

Return type:

float

in_unit(
self: ostk.physics.time.Duration,
arg0: ostk.physics.unit.Time.Unit,
) ostk.core.type.Real

Get the duration in a unit.

Returns:

Duration in unit.

Return type:

float

in_weeks(self: ostk.physics.time.Duration) ostk.core.type.Real

Get the duration in weeks.

Returns:

Duration in weeks.

Return type:

float

is_defined(self: ostk.physics.time.Duration) bool

Check if the duration is defined.

Returns:

True if defined.

Return type:

bool

is_near(
self: ostk.physics.time.Duration,
duration: ostk.physics.time.Duration,
tolerance: ostk.physics.time.Duration,
) bool

Check if the duration is near another duration.

Parameters:
  • duration (Duration) -- Duration to compare with.

  • tolerance (Duration) -- Tolerance.

Returns:

True if near.

Return type:

bool

is_positive(self: ostk.physics.time.Duration) bool

Check if the duration is positive.

Returns:

True if positive.

Return type:

bool

is_strictly_positive(self: ostk.physics.time.Duration) bool

Check if the duration is strictly positive.

Returns:

True if strictly positive.

Return type:

bool

is_zero(self: ostk.physics.time.Duration) bool

Check if the duration is zero.

Returns:

True if zero.

Return type:

bool

static microseconds(arg0: ostk.core.type.Real) ostk.physics.time.Duration

Create a duration in microseconds.

Returns:

Duration in microseconds.

Return type:

Duration

static milliseconds(arg0: ostk.core.type.Real) ostk.physics.time.Duration

Create a duration in milliseconds.

Returns:

Duration in milliseconds.

Return type:

Duration

static minutes(arg0: ostk.core.type.Real) ostk.physics.time.Duration

Create a duration in minutes.

Returns:

Duration in minutes.

Return type:

Duration

static nanoseconds(arg0: ostk.core.type.Real) ostk.physics.time.Duration

Create a duration in nanoseconds.

Returns:

Duration in nanoseconds.

Return type:

Duration

static parse(
string: ostk.core.type.String,
format: ostk.physics.time.Duration.Format = <Format.Undefined: 0>,
) ostk.physics.time.Duration
static seconds(arg0: ostk.core.type.Real) ostk.physics.time.Duration

Create a duration in seconds.

Returns:

Duration in seconds.

Return type:

Duration

to_string(*args, **kwargs)

Overloaded function.

  1. to_string(self: ostk.physics.time.Duration) -> ostk.core.type.String

  2. to_string(self: ostk.physics.time.Duration, arg0: ostk::physics::time::Duration::Format) -> ostk.core.type.String

to_timedelta(self: ostk.physics.time.Duration) datetime.timedelta
static undefined() ostk.physics.time.Duration

Create an undefined duration.

Returns:

Undefined duration.

Return type:

Duration

static weeks(arg0: ostk.core.type.Real) ostk.physics.time.Duration

Create a duration in weeks.

Returns:

Duration in weeks.

Return type:

Duration

static zero() ostk.physics.time.Duration

Create a zero duration.

Returns:

Zero duration.

Return type:

Duration