Duration#

class Duration(**properties: Any)#

Superclasses: Object, Object

This is the ICalDuration instance.

Constructors#

class Duration
classmethod new_bad_duration() Duration#

Creates a bad Duration.

Added in version 1.0.

classmethod new_from_int(t: int) Duration#

Creates a Duration from the duration in second.

Added in version 1.0.

Parameters:

t – The duration in second

classmethod new_from_string(str: str) Duration#

Creates a Duration from the duration in string.

Added in version 1.0.

Parameters:

str – The string representation of the duration

classmethod new_null_duration() Duration#

Creates a Duration with all the fields to be zero.

Added in version 1.0.

Methods#

class Duration
as_ical_string() str#

Converts the Duration to the representation in string.

Added in version 1.0.

as_int() int#

Converts the Duration to the representation in second.

Added in version 1.0.

get_days() int#

Gets the days of Duration.

Added in version 1.0.

get_hours() int#

Gets the hours of Duration.

Added in version 1.0.

get_minutes() int#

Gets the minutes of Duration.

Added in version 1.0.

get_seconds() int#

Gets the seconds of Duration.

Added in version 1.0.

get_weeks() int#

Gets the weeks of Duration.

Added in version 1.0.

is_bad_duration() bool#

Checks whether the Duration is the bad_duration.

Added in version 1.0.

is_neg() bool#

Gets the is_neg of Duration.

Added in version 1.0.

is_null_duration() bool#

Checks whether the Duration is the null_duration.

Added in version 1.0.

set_days(days: int) None#

Sets the days of Duration.

Added in version 1.0.

Parameters:

days – The days

set_hours(hours: int) None#

Sets the hours of Duration.

Added in version 1.0.

Parameters:

hours – The hours

set_is_neg(is_neg: bool) None#

Sets the is_neg of Duration.

Added in version 1.0.

Parameters:

is_neg – The is_neg

set_minutes(minutes: int) None#

Sets the minutes of Duration.

Added in version 1.0.

Parameters:

minutes – The minutes

set_seconds(seconds: int) None#

Sets the seconds of Duration.

Added in version 1.0.

Parameters:

seconds – The seconds

set_weeks(weeks: int) None#

Sets the weeks of Duration.

Added in version 1.0.

Parameters:

weeks – The weeks