datetime オブジェクトを調べてみる
自分用メモ。
Datastoreに指定の日付を入力しようとしてちょっと引っかかった。
Python ライブラリのdatetime オブジェクト
http://www.python.jp/doc/release/lib/datetime-datetime.html
http://newcamel.logos.ic.i.u-tokyo.ac.jp/~s1s5/pukiwiki/index.php?programming%2Fpython%2Fdatetime
ここらへんを見ながらなんとか入力できるようにする。
こんなかんじ。
import wsgiref.handlers import datetime from google.appengine.ext import webapp from google.appengine.ext import db class testdb(db.Model): date = db.DateTimeProperty() class MainPage(webapp.RequestHandler): def get(self): temp_date = testdb(date=datetime.datetime(2007, 10, 16, 10, 11, 23, 000000)) # データストアに保存 temp_date.put() def main(): application = webapp.WSGIApplication( [ ('/', MainPage), ], debug=True) wsgiref.handlers.CGIHandler().run(application) if __name__ == "__main__": main()