python time.strftime %z is always zero instead of timezone offset
问题 >>> import time >>> t=1440935442 >>> time.strftime("%Y/%m/%d-%H:%M:%S %z",time.gmtime(t)) '2015/08/30-11:50:42 +0000' >>> time.strftime("%Y/%m/%d-%H:%M:%S %z",time.localtime(t)) '2015/08/30-13:50:42 +0000' The offset stays the same +0000, but I expect '2015/08/30-13:50:42 +0200' The timezone is correct, as the command is interpreting capital %Z as it should >>> time.strftime("%Y/%m/%d-%H:%M:%S %Z",time.localtime(t)) '2015/08/30-13:50:42 CEST' Unix date works like I want $ date -u --date