3 ms·
Django solves this by having the default timezone in the framework settings. Any datetime without a timezone is assumed to be using the default one. If you don'
by BiteCode_dev 4y ago
Django solves this by having the default timezone in the framework settings. Any datetime without a timezone is assumed to be using the default one. If you don't set a default timezone, the server timezone is used, and you are responsible for making sure your data is congruent.
- stingraycharles 4y agoYes I know, but that doesn’t help pretty much any of our Python users that are all heavily reliant on Pandas and/or definitely not writing web services. As of now, we just reject any timestamp without an explicit timezone and try to explain to our users why utcnow() is bad. People are generally very surprised that this issue exists at all.
- BiteCode_dev 4y agoYeah naive datetime should not even exist in high level API IMO. They're like bytes string with no encoding or geospatial data without a projection name field. It's going to bite you at some point.