2011年10月6日 星期四

Google App Engine Parse Zulu Date

在Google App Engine的環境是python 2.5.2
所以datetime.strptime不支援「%f」

因此簡單使用此方式截掉毫秒。
datetime.strptime(string[:string.index('.')], '%Y-%m-%dT%H:%M:%S')

沒有留言:

張貼留言