 |
python - datetime.datetime.utcnow() why no tzinfo? - Stack Overflow
That means it is timezone naive, so you can't use it with datetime.astimezone you can give it a timezone like this import pytz # 3rd party u=datetime.utcnow() u=u.replace(tzinfo=pytz.utc) now you can change timezones print datetime.astimezone(u, pytz.time
stackoverflow.com |
 |