Skip to content

Instantly share code, notes, and snippets.

@begoat
Forked from ciiiii/fuck-datetime.py
Last active August 24, 2018 06:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save begoat/80be75c79469adc8c04ea22c851612ee to your computer and use it in GitHub Desktop.
Save begoat/80be75c79469adc8c04ea22c851612ee to your computer and use it in GitHub Desktop.
python get time of one timezone
from datetime import datetime, timedelta
from pytz import timezone
(datetime.now(tz=timezone('UTC'))+timedelta(minutes=WECHAT_QRCODE_EXPIRE_MINS))
.astimezone(timezone('Asia/Shanghai')).strftime("%Y%m%d%H%M%S")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment