我的代码:
import time
print hasattr(time.tzset)#error
Run Code Online (Sandbox Code Playgroud)
为什么有人这样做下一个:
if hasattr(time, 'tzset'):
# Move the time zone info into os.environ. See ticket #2315 for why
# we don't do this unconditionally (breaks Windows).
os.environ['TZ'] = self.TIME_ZONE
time.tzset()
Run Code Online (Sandbox Code Playgroud)
我无法理解.
谢谢