Open fluffy-critter opened 5 years ago
Experienced this again when building the submission system for novembeat.com; it seems that the Date header is always being interpreted as localtime instead of the declared timezone. It seems that arrow.get(..., tzinfo=foo)
always overrides the timezone even if one is specified.
There's probably some mechanism in arrow to determine if the provided date was timezone-aware, and only overriding tzinfo if it wasn't.
Just got hit by this again while traveling across time zones. Maybe actually fix this one?
Expected Behavior
If a site is configured for e.g. UTC-7 and there's an entry posted in the native time for UTC-5, the entry visibility and relative time offset (in
entry.date.humanize()
) should be based on the time in UTC-5.Current Behavior
The timestamp is interpreted as local time regardless of its declared timezone; offsets are being computed based on naive/local dates instead of utcnow.
Context
While traveling to Wisconsin, I posted an entry in UTC-5, which appeared to be 2 hours in the future and thus was treated as scheduled.
Date header:
Entry display:
database entry:
This feels like a regression on an aspect which has always caused trouble in one way or another.