On 2/7/22 21:18, David Newman wrote:
On 2/4/22 10:29 AM, Mark Sapiro wrote:
The appropriate setting for Django is always
TIME_ZONE = 'UTC'
because the time passed from Mailman core is a naive datetime.datetime object and is actually UTC.Could use clarification on this. Are you referring to the settings.py file, or something else?
Settings.py
Asking because my settings.py currently has:
# Django time zones USE_TZ = True TIME_ZONEĀ = 'America/Los_Angeles'
It should be TIME_ZONE = 'UTC'
Times passed from Mailman core are naive times, I.e. they don't have time zone info, but they are in UTC. Thus for Django to get the correct time with time zone you need USE_TZ = True (without that, Django will throw an exception about naive times) and the TIME_ZONE to apply is UTC.
With those settings, Django has the correct time zone aware times.
and list timestamps appear to work OK both in Hyperkitty and as received by members' mail clients.
Mail sent to list members is not at all affected by this. That involves Mailman core only. Also, time stamps on posts in HyperKitty come from Date: headers or Django internal times. Where you see this manifested is for example when looking at a held message in Postorius and seeing the hold time. which is a time stamp generated by Mailman core.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan