Skip to content

DateTime

Canonical path: o6.DateTime

DateTime

OPC UA DateTime: 100-nanosecond ticks since 1601-01-01 (UTC).

Constructible from a datetime.datetime, from another DateTime, from a raw tick count, or from an ISO-8601 string. A naive datetime is read as local time and stored as UTC, so attach a tzinfo to control the conversion. DateTime() is the OPC UA epoch, not the current time, and int(value) returns the tick count.

The comparison operators are only meaningful against another DateTime; comparing against a tick count or a datetime reports inequality instead of raising.

Functions

__init__

__init__() -> None
__init__(date: datetime) -> None
__init__(date: DateTime | int | str) -> None
__init__(*args, **kwargs)