Skip to content Skip to sidebar Skip to footer

Working Datetime Objects In Google App Engine

In this model class Rep(db.Model): mAUTHOR = db.UserProperty(auto_current_user=True) mUNIQUE = db.StringProperty() mCOUNT = db.IntegerProperty() mDATE = db.DateTime

Solution 1:

This should do what you want:

importtimemWEIGHT= mCOUNT / time.mktime(mDATE0.utctimetuple())

See mktime.

mCOUNT / mDATE0.date fails because there is no division operator for int and date.

toordinal doesn't suit you because it operates on dates and disregards time completely.

Post a Comment for "Working Datetime Objects In Google App Engine"