-
-
Save begoat/80be75c79469adc8c04ea22c851612ee to your computer and use it in GitHub Desktop.
python get time of one timezone
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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