py-pgproto icon indicating copy to clipboard operation
py-pgproto copied to clipboard

datetime: convert timestamptz to local timezone

Open TheJJ opened this issue 2 years ago • 3 comments

This fixes MagicStack/asyncpg#1006 :)

TheJJ avatar Feb 22 '23 15:02 TheJJ

can this please be merged?

TheJJ avatar Apr 08 '23 17:04 TheJJ

This is technically a backwards-incompatible change as clients might stringify returned datetime objects or otherwise rely on the timezone being UTC. I would play it safe and add a configuration knob to CodecContext.

elprans avatar Aug 17 '23 21:08 elprans

Would you be willing to implement that? Or is there another way of defaulting timezone-including datetime objects? As the timestamptz does include the timezone, returning it as UTC seems a bug to me.

TheJJ avatar Aug 21 '23 15:08 TheJJ