Skip to main content

is_naive

Determine if a given datetime.datetime is naive.

The concept is defined in Python's docs: https://docs.python.org/library/datetime.html#datetime.tzinfo

Assuming value.tzinfo is either None or a proper datetime.tzinfo, value.utcoffset() implements the appropriate logic.

def is_naive(
value: datetime.datetime
) - > boolean

Determine if a given datetime.datetime is naive. The concept is defined in Python's docs: https://docs.python.org/library/datetime.html#datetime.tzinfo Assuming value.tzinfo is either None or a proper datetime.tzinfo, value.utcoffset() implements the appropriate logic.

Parameters

NameTypeDescription
valuedatetime.datetimeThe datetime instance to check for timezone awareness

Returns

TypeDescription
booleanTrue if the datetime object has no timezone information, False otherwise