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.
Pytz library should be useful. Using Pytz (supports > 2.3) below code can get you the time according to eastern timezone.
from datetime import datetime, timedelta
from pytz import timezone
eastern = timezone('US/Eastern')
fmt = '%Y-%m-%d %H:%M:%S %Z%z'
loc_dt = eastern.localize(datetime(2012, 10, 29, 6, 0, 0))
print loc_dt.strftime(fmt)