Bug report
Bug description:
this function does not support datetime.time
| (dt.toordinal() -EPOCHORDINAL) *86400 |
deftest():
fromzoneinfoimportZoneInfofromdatetimeimporttimet=time(12, 4, 5, 123456, tzinfo=ZoneInfo("Europe/Prague"), fold=1)
ift.tzinfo.utcoffset(None) isNone:
# if prevuous does not work this should but fails with# AttributeError: 'datetime.time' object has no attribute 'toordinal't.tzinfo.utcoffset(t)i propose checking if instance is time and then skip to ordinal like so
def_get_local_timestamp(self, dt):
return (
(dt.toordinal() -EPOCHORDINAL) *86400ifnotisinstance(dt, time) else0+dt.hour*3600+dt.minute*60+dt.second
)
this issue is blocker for pydantic/speedate#62
if this is confirmed i am open to do PR or leave it to someone else Maybe there is something more i am not seeing
CPython versions tested on:
3.12
Operating systems tested on:
macOS
Bug report
Bug description:
this function does not support datetime.time
cpython/Lib/zoneinfo/_zoneinfo.py
Line 187 in 558b517
i propose checking if instance is time and then skip to ordinal like so
this issue is blocker for pydantic/speedate#62
if this is confirmed i am open to do PR or leave it to someone else Maybe there is something more i am not seeing
CPython versions tested on:
3.12
Operating systems tested on:
macOS