Try this:

    message.timestamp = message.created.strftime("%I:%M %p")

You are confusing time.strftime() with datetime.datetime.strftime()

On Sep 21, 4:13 pm, Sam G <[EMAIL PROTECTED]> wrote:
> 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"?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to