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
| Attribute | Type | Description |
|---|---|---|
| Raw | DateTime | Stores a native DateTime object used for internal date and time calculations. |
| Py | Bound< '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
| Name | Type | Description |
|---|---|---|
| value | Union[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
| Name | Type | Description |
|---|---|---|
| DateTime | DateTime | The native date and time object to be wrapped. |
Signature
def Py(
PyDateTime: Bound< 'a, PyDateTime >
) - > [EitherDateTime](eitherdatetime.md?sid=input_datetime_eitherdatetime)
Parameters
| Name | Type | Description |
|---|---|---|
| PyDateTime | Bound< 'a, PyDateTime > | The Python-bound date-time object reference. |