Skip to main content

EitherDateTime

This class represents a date-time value that can exist as either a native internal DateTime structure or a bound Python PyDateTime object. It provides a flexible interface for handling date-time data across different representation formats within a single type.

Attributes

AttributeTypeDescription
RawDateTimeStores a native DateTime object used for internal date and time calculations.
PyBound< 'a, PyDateTime >Stores a reference to a Python PyDateTime object for interoperability with Python's datetime module.

Constructor

Signature

def EitherDateTime(
value: Union[DateTime, Bound[PyDateTime]]
)

Parameters

NameTypeDescription
valueUnion[DateTime, Bound[PyDateTime]]The datetime value to be stored, either as a native DateTime or a Python-bound PyDateTime.

Signature

def Raw(
DateTime: DateTime
) - > [EitherDateTime](eitherdatetime.md?sid=input_datetime_eitherdatetime)

Parameters

NameTypeDescription
DateTimeDateTimeThe native date and time object to be wrapped.

Signature

def Py(
PyDateTime: Bound< 'a, PyDateTime >
) - > [EitherDateTime](eitherdatetime.md?sid=input_datetime_eitherdatetime)

Parameters

NameTypeDescription
PyDateTimeBound< 'a, PyDateTime >The Python-bound date-time object reference.