Module datetime

Source
Available on non-Py_LIMITED_API only.
Expand description

FFI bindings to the functions and structs defined in datetime.h

This is the unsafe thin wrapper around the CPython C API, and covers the various date and time related objects in the Python datetime standard library module.

Macrosยง

_PyDateTime_GET_FOLD ๐Ÿ”’ Neither PyPy nor GraalPy
_PyDateTime_GET_HOUR ๐Ÿ”’ Neither PyPy nor GraalPy
_PyDateTime_GET_MICROSECOND ๐Ÿ”’ Neither PyPy nor GraalPy
_PyDateTime_GET_MINUTE ๐Ÿ”’ Neither PyPy nor GraalPy
_PyDateTime_GET_SECOND ๐Ÿ”’ Neither PyPy nor GraalPy
_PyDateTime_GET_TZINFO ๐Ÿ”’ Neither PyPy nor GraalPy
_access_delta_field ๐Ÿ”’ Neither PyPy nor GraalPy
_access_field ๐Ÿ”’ Neither PyPy nor GraalPy

Structsยง

PyDateTimeAPISingleton ๐Ÿ”’
PyDateTime_CAPI
PyDateTime_Date
Structure representing a datetime.date
PyDateTime_DateTime
Structure representing a datetime.datetime.
PyDateTime_Delta
Structure representing a datetime.timedelta.
PyDateTime_Time
Structure representing a datetime.time.
_PyDateTime_BaseDateTimeNeither PyPy nor GraalPy
Structure representing a datetime.datetime without a tzinfo member.
_PyDateTime_BaseTimeNeither PyPy nor GraalPy
Structure representing a datetime.time without a tzinfo member.

Constantsยง

PyDateTime_CAPSULE_NAME
_PyDateTime_DATETIME_DATASIZE ๐Ÿ”’
_PyDateTime_DATE_DATASIZE ๐Ÿ”’
_PyDateTime_TIME_DATASIZE ๐Ÿ”’

Staticsยง

PyDateTimeAPI_impl ๐Ÿ”’

Functionsยง

PyDateTimeAPIโš 
Returns a pointer to a PyDateTime_CAPI instance
PyDateTime_Checkโš 
Check if op is a PyDateTimeAPI.DateTimeType or subtype.
PyDateTime_CheckExactโš 
Check if opโ€™s type is exactly PyDateTimeAPI.DateTimeType.
PyDateTime_DATE_GET_FOLDโš Neither PyPy nor GraalPy
Retrieve the fold component of a PyDateTime_DateTime. Returns a signed integer in the interval [0, 1]
PyDateTime_DATE_GET_HOURโš Neither PyPy nor GraalPy
Retrieve the hour component of a PyDateTime_DateTime. Returns a signed integer in the interval [0, 23]
PyDateTime_DATE_GET_MICROSECONDโš Neither PyPy nor GraalPy
Retrieve the microsecond component of a PyDateTime_DateTime. Returns a signed integer in the interval [0, 999999]
PyDateTime_DATE_GET_MINUTEโš Neither PyPy nor GraalPy
Retrieve the minute component of a PyDateTime_DateTime. Returns a signed integer in the interval [0, 59]
PyDateTime_DATE_GET_SECONDโš Neither PyPy nor GraalPy
Retrieve the second component of a PyDateTime_DateTime. Returns a signed integer in the interval [0, 59]
PyDateTime_DATE_GET_TZINFOโš Neither PyPy nor GraalPy
Retrieve the tzinfo component of a PyDateTime_DateTime. Returns a pointer to a PyObject that should be either NULL or an instance of a datetime.tzinfo subclass.
PyDateTime_DELTA_GET_DAYSโš Neither PyPy nor GraalPy
Retrieve the days component of a PyDateTime_Delta.
PyDateTime_DELTA_GET_MICROSECONDSโš Neither PyPy nor GraalPy
Retrieve the seconds component of a PyDateTime_Delta.
PyDateTime_DELTA_GET_SECONDSโš Neither PyPy nor GraalPy
Retrieve the seconds component of a PyDateTime_Delta.
PyDateTime_FromTimestampโš Non-PyPy
PyDateTime_GET_DAYโš Neither PyPy nor GraalPy
Retrieve the day component of a PyDateTime_Date or PyDateTime_DateTime. Returns a signed integer in the interval [1, 31].
PyDateTime_GET_MONTHโš Neither PyPy nor GraalPy
Retrieve the month component of a PyDateTime_Date or PyDateTime_DateTime. Returns a signed integer in the range [1, 12].
PyDateTime_GET_YEARโš Neither PyPy nor GraalPy
Retrieve the year component of a PyDateTime_Date or PyDateTime_DateTime. Returns a signed integer greater than 0.
PyDateTime_IMPORTโš 
Populates the PyDateTimeAPI object
PyDateTime_TIME_GET_FOLDโš Neither PyPy nor GraalPy
Retrieve the fold component of a PyDateTime_Time. Returns a signed integer in the interval [0, 1]
PyDateTime_TIME_GET_HOURโš Neither PyPy nor GraalPy
Retrieve the hour component of a PyDateTime_Time. Returns a signed integer in the interval [0, 23]
PyDateTime_TIME_GET_MICROSECONDโš Neither PyPy nor GraalPy
Retrieve the microsecond component of a PyDateTime_DateTime. Returns a signed integer in the interval [0, 999999]
PyDateTime_TIME_GET_MINUTEโš Neither PyPy nor GraalPy
Retrieve the minute component of a PyDateTime_Time. Returns a signed integer in the interval [0, 59]
PyDateTime_TIME_GET_SECONDโš Neither PyPy nor GraalPy
Retrieve the second component of a PyDateTime_DateTime. Returns a signed integer in the interval [0, 59]
PyDateTime_TIME_GET_TZINFOโš Neither PyPy nor GraalPy
Retrieve the tzinfo component of a PyDateTime_Time. Returns a pointer to a PyObject that should be either NULL or an instance of a datetime.tzinfo subclass.
PyDateTime_TimeZone_UTCโš 
PyDate_Checkโš 
Type Check macros
PyDate_CheckExactโš 
Check if opโ€™s type is exactly PyDateTimeAPI.DateType.
PyDate_FromTimestampโš Non-PyPy
PyDelta_Checkโš 
Check if op is a PyDateTimeAPI.DetaType or subtype.
PyDelta_CheckExactโš 
Check if opโ€™s type is exactly PyDateTimeAPI.DeltaType.
PyTZInfo_Checkโš 
Check if op is a PyDateTimeAPI.TZInfoType or subtype.
PyTZInfo_CheckExactโš 
Check if opโ€™s type is exactly PyDateTimeAPI.TZInfoType.
PyTimeZone_FromOffsetโš 
PyTimeZone_FromOffsetAndNameโš 
PyTime_Checkโš 
Check if op is a PyDateTimeAPI.TimeType or subtype.
PyTime_CheckExactโš 
Check if opโ€™s type is exactly PyDateTimeAPI.TimeType.
โš ๏ธ Internal Docs โš ๏ธ Not Public API ๐Ÿ‘‰ Official Docs Here