2011-03-16 68 views

回答

12

是的,你需要的pytz庫:

import datetime, pytz 
zoneName = 'America/New_York' 
now = datetime.datetime.now(pytz.timezone(zoneName)) 

回報:

datetime.datetime(2011, 3, 16, 1, 39, 33, 87375, tzinfo=<DstTzInfo 'America/New_York' EDT-1 day, 20:00:00 DST>)