3 ms·
I was recently working with stock data from a Django shop, half of their Unix timestamps were correct timestamps, the other half had a local timezone offset bak
by qwertox 3y ago
I was recently working with stock data from a Django shop, half of their Unix timestamps were correct timestamps, the other half had a local timezone offset baked right into the integer.
At least this time finding problematic code will be a grep away, so I'm ok with this change, even though I've used it a lot.
Edit: Wow. So Paul Ganssle writes in April "Previously, we have documented that utcnow and utcfromtimestamp should not be used , but we didn’t go so far as to actually deprecate them [...]"
The linked to issue where this was decided is from Jul-Sep 2019. And I've never heard about this. Obviously this is my fault, but: where do I need to inform myself to know about these decisions? I've been "happily" using them all the time (quoted because we're all aware of the challenges these conversions pose each and every time).
[0] https://github.com/python/cpython/issues/81669 https://github.com/python/cpython/issues/81669