View Single Post
  #18  
Old 10th November 2020, 07:21 AM
chook chook is offline
Member
 
Join Date: Jan 2019
Posts: 14
Talking 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
Reply With Quote