Skip to main content

OFTDateTime

This class represents a date and time field within a geographic data layer. It provides a property to convert the underlying field data into a native Python datetime object. The class handles the extraction of year, month, day, hour, minute, and second components from the field's raw value.

Attributes

AttributeTypeDescription
valuedatetimeReturn a Python datetime object for this OFTDateTime field.

Constructor

Signature

def OFTDateTime()

Methods


value()

@classmethod
def value() - > datetime

Return a Python datetime object for this OFTDateTime field.

Returns

TypeDescription
datetimeA Python datetime object representing the field value, or None if the conversion fails due to invalid data or GDAL errors.