K, been trying to get this figured out for a few hours. Time to ask for help.
Times being displayed in the app are not correct with the change in daylight savings time.
Dates are UTC(GMT) being stored and queried from Airtable.
Looks like the dates being served to the app are OK.
Server module returns a string from the API and converts to datetime object
** The third being after the DST Change
2021-10-28 14:47:48.347000+00:00
<anvil.tz.tzoffset (0 hours)>
2021-11-05 14:47:00+00:00
<anvil.tz.tzoffset (0 hours)>
2021-11-09 15:47:00+00:00
<anvil.tz.tzoffset (0 hours)>
Here is my local format function (In a client module)
def dtm_local_pretty(dtm):
print(dtm)
print(dtm.tzinfo)
dtm_lp = dtm.astimezone(tz.tzlocal()).strftime("%b %d %Y %I:%M %p")
print(f'THE dtm_local is: {dtm_lp}')
return dtm_lp
Here is the result:
THE dtm_local is: Oct 28 2021 10:47 AM
THE dtm_local is: Nov 05 2021 10:47 AM
THE dtm_local is: Nov 09 2021 11:47 AM
The offset after 11/7 should be 5 hours and display 10:47 AM
How do I make this DST aware?
Thanks for your help,