I'm probably missing an obvious platform difference that I should be accommodating but I'm getting this when trying to do a time format (Python2.7)...
in Linux env:
>>> import time
>>> time.strftime("%a, %d-%b-%Y %T GMT", time.gmtime())
'Tue, 29-May-2012 21:42:04 GMT'
in Windows:
>>> import time
>>> time.strftime("%a, %d-%b-%Y %T GMT", time.gmtime())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: Invalid format string
The tuples returned from time.gmtime() appear to be the same, so I'm not completely sure what I need to change.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…