MCPcopy
hub / github.com/tortoise/tortoise-orm / is_naive

Function is_naive

tortoise/timezone.py:133–143  ·  view source on GitHub ↗

Determine if a given datetime.datetime or datetime.time 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 appropria

(value: datetime | time)

Source from the content-addressed store, hash-verified

131
132
133def is_naive(value: datetime | time) -> bool:
134 """
135 Determine if a given datetime.datetime or datetime.time is naive.
136
137 The concept is defined in Python's docs:
138 https://docs.python.org/library/datetime.html#datetime.tzinfo
139
140 Assuming value.tzinfo is either None or a proper datetime.tzinfo,
141 value.utcoffset() implements the appropriate logic.
142 """
143 return value.utcoffset() is None
144
145
146def make_aware(

Callers 2

localtimeFunction · 0.85
make_naiveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…