How can I get Python to display the time in eastern?
I\'ve looked over the python documentation but it\'s pretty confusing. I\'m using Python 3.
Thanks.
If you need the entire timestamp:
import datetime print (datetime.datetime.utcnow() - datetime.timedelta(hours=4))
If you just need the date in YYYYmmdd format
print (datetime.datetime.utcnow() - datetime.timedelta(hours=4)).strftime('%Y%m%d')