Reputation: 3235
I tried just using the date's string representation but it didn't work (i.e. no results):
gql = "SELECT * from Shout where when='2010-11-05 16:57:45.675612'"
This is my Shout class:
class Shout(db.Model):
message= db.StringProperty(required=True)
when = db.DateTimeProperty(auto_now_add=True)
who = db.StringProperty()
Upvotes: 0
Views: 1020
Reputation: 169334
gql = "SELECT * FROM Shout WHERE when = DATETIME('2010-11-05 16:57:45')"
Per documentation, use the following for date/time literals:
DATETIME()
with timestamps, DATE()
with dates, TIME()
with timesAn alternative syntax is:
SELECT * FROM Shout WHERE when = DATETIME(2010,11,5,16,57,45)
Upvotes: 1