[EMAIL PROTECTED] wrote:
> I am using this code to parse a datetime supplied by magnolia's api
> into a valid Python DateTime:
> 
> datetime(*(time.strptime(link("created").replace("-08:00",
> "").replace("-07:00", ""), "%Y-%m-%dT%H:%M:%S")[0:6]))

note that local variables are very cheap in Python, so you don't really 
save much by insisting on writing it all on one very long line.

(also note that the datetime class has a strptime constructor)

> How could I alter this so that it adds 8 hours onto the datetime before
> storing it in the db?

add datetime.timedelta(hours=8) to the datetime object.

</F>


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to