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)
| 131 | |
| 132 | |
| 133 | def 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 | |
| 146 | def make_aware( |
no outgoing calls
no test coverage detected
searching dependent graphs…