Created
October 31, 2018 18:21
-
-
Save deeshank/5aa85a6c35b149545075c355acf4e628 to your computer and use it in GitHub Desktop.
Python Current Timestamp w/ 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
## Credits: https://julien.danjou.info/python-and-timezones/ | |
import datetime | |
import pytz | |
utc_now = datetime.datetime.now(tz=pytz.utc) | |
print utcnow().isoformat() | |
# '2015-06-15T14:45:21.982600+00:00' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment