10th November 2020, 07:21 AM
|
Member
|
|
Join Date: Jan 2019
Posts: 14
|
|
cookbook
O'Reilley python cookbook 3 Beazley & Jones
advise using UTC for your time calcs and then moving to local timezone.
chapter 3.16, P 110 in third ed.
from datetime import datetime
#get your UTC date time
dt = datetime(2020,12,20,9,31,22)
from pytz import timezone
nsw = timezone( 'Australia/NSW' )
# = nsw.localize( your UTC date time )
ndt = nsw.localize( dt )
an alternative is to use Queensland time and check to see if you are in summer, by looking at your localtime.
i have done that before
or, move to Queensland
|