Sam G
unread,Sep 21, 2008, 1:13:47 AM9/21/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google App Engine
Hello (again),
I'm a bit mystified about the db.DateTimeProperty. In the Datastore
API's Types and Properties documentation, it lists the Python object
type as datetime.datetime.
However, when I try to convert this datetime.datetime object to a
string, I get a "argument must be 9-item sequence, not
datetime.datetime" error.
Here's the code:
import time
...
message.timestamp = time.strftime("%I:%M %p", message.created)
The variable "message.created" is a DateTimeProperty that is retrieved
from the datastore.
Is there an easier way (or one that works) for converting a
DateTimeProperty to something like "11:34 AM"?