inserting a date/time in "RFC 3339" format into django DateTimeField

531 views
Skip to first unread message

Ahmad

unread,
Mar 13, 2012, 9:46:50 AM3/13/12
to django...@googlegroups.com
I'm trying to insert date/time as I'm storing data retrieved from google calendar api about event start and end date.
here is the RFC link RFC 3339

Tom Evans

unread,
Mar 13, 2012, 10:11:49 AM3/13/12
to django...@googlegroups.com

DateTimeField wants a python datetime.datetime object. You can use
datetime.strptime and datetime.strftime to parse and format a datetime
field how you desire.

http://docs.python.org/library/datetime.html#strftime-strptime-behavior

Cheers

Tom

Reply all
Reply to author
Forward
0 new messages