import datetime, pytzdatetime.datetime.now(pytz.timezone('Asia/Jerusalem')).strftime('%z')# returns '+0300' (because 'now' they have DST)pytz.timezone('Asia/Jerusalem').localize(datetime.datetime(2011,1,1)).strftime('%z')# returns '+0200' (because in January they didn't have DST)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)