help(datetime) 导致python库的datetime部分澄清了这一点 gmtime 和 strftime 原来是我要找的:
help(datetime)
gmtime
strftime
import time print("\nGMT: "+time.strftime("%a, %d %b %Y %I:%M:%S %p %Z", time.gmtime())) print("Local: "+strftime("%a, %d %b %Y %I:%M:%S %p %Z\n"))