Data Types
In order to provide full compatibility with the Erbsland Configuration Language, this implementation provides a number of data types. The classes Time
and DateTime
extend the built-in datetime.time
and datetime.datetime
classes by adding nanosecond precision. The class TimeDelta
simply combines a count with a time unit and provides conversion to datetime.timedelta
, yet only for units that are supported by Python.
Interface
- class Time(hour: int, minute: int, *, second: int = 0, microsecond: int = 0, nanosecond: int = 0, tzinfo=None, fold: int = 0)
Represents a time of day with nanosecond precision.
This class wraps
datetime.time
to carry nanoseconds when needed. Any further operation on this class drops the nanosecond precision.
- class DateTime(year: int, month: int, day: int, *, hour: int = 0, minute: int = 0, second: int = 0, microsecond: int = 0, nanosecond: int = 0, tzinfo=None, fold: int = 0)
Represents a combined date and time with nanosecond precision.
This class wraps
datetime.datetime
to carry nanoseconds when needed. Any operation on this class drops the nanosecond precision.- classmethod fromisoformat(date_time_string: str) DateTime
string -> datetime from a string in most ISO 8601 formats