Skip to content

Instantly share code, notes, and snippets.

@ciiiii
Created August 22, 2018 04:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ciiiii/f40875d230764e61ad481445a8e600ff to your computer and use it in GitHub Desktop.
Save ciiiii/f40875d230764e61ad481445a8e600ff to your computer and use it in GitHub Desktop.
python get time of one timezone
import datetime
from pytz import timezone
now = datetime.datetime.now(tz=timezone('UTC')).astimezone(timezone('Asia/Shanghai'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment