Skip to content

Instantly share code, notes, and snippets.

@shadowmint
Created October 23, 2014 05:02
Show Gist options
  • Save shadowmint/d1de307bf87c01f961fe to your computer and use it in GitHub Desktop.
Save shadowmint/d1de307bf87c01f961fe to your computer and use it in GitHub Desktop.
import pytz
import datetime
value = datetime.time(hour=12, minute=0, tzinfo=pytz.timezone('Australia/Perth'))
print pytz.timezone('Australia/Perth').utcoffset(value)
value = datetime.time(hour=12, minute=0, tzinfo=pytz.timezone('Australia/Perth'))
print pytz.timezone('Australia/Perth').utcoffset(datetime.datetime.utcnow())
doug-2:rac-autoservices.rac.com.au doug$ ./bin/python junk.py
7:43:00
8:00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment