typesystem icon indicating copy to clipboard operation
typesystem copied to clipboard

Timezones for `DateTime` fields

Open lovelydinosaur opened this issue 6 years ago • 1 comments

lovelydinosaur avatar Mar 05 '19 16:03 lovelydinosaur

@tomchristie What are your thoughts on normalizing timezones to UTC on serialization? Most RDBMS's will return localized datetimes to clients

All timezone-aware dates and times are stored internally in UTC. They are converted to local time in the zone specified by the TimeZone configuration parameter before being displayed to the client.

https://www.postgresql.org/docs/11/datatype-datetime.html

I see that typesystem does not convert datetimes to UTC, and marshmallow recently changed to do the same.

But one could argue that UTC normalization is a view-level concern rather than model-level concern, so perhaps it makes sense for serialization libs to take care of this. What do you think?

sloria avatar Aug 07 '19 15:08 sloria