asyncpg icon indicating copy to clipboard operation
asyncpg copied to clipboard

set value to datetime.time for TIME type is not working

Open erhuabushuo opened this issue 3 years ago • 1 comments

column type is TIME. when set value to datetime.time, I got this exception.

asyncpg.exceptions.DataError: invalid input for query argument $10: datetime.time(0, 1, 2, tzinfo=<DstTzInfo... ('NoneType' object has no attribute 'days')

erhuabushuo avatar May 28 '22 08:05 erhuabushuo

I'm having the same issue, though it seems to only break for timezones with Daylight Savings Time. Of the following tzinfos, the first two works just fine, and the last one raises the same error you get:

>>> pytz.timezone('UTC')
<UTC>
>>> pytz.timezone('GMT')
<StaticTzInfo 'GMT'>
>>> pytz.timezone('CET')
<DstTzInfo 'CET' CET+1:00:00 STD>

frodejac avatar Oct 29 '22 11:10 frodejac