Application Engine: string to datetime?

I have a line

date = "11/28/2009" hour = "23" minutes = "59" seconds = "00" 

How can I convert a datetime object and save it in a data store?

+6
python datetime
source share
1 answer

Sorry if this is not what you want, but at least for the first part of the question, you could probably do it like this?

 >>> import datetime >>> datetime.datetime.strptime(date + ' ' + hour + ':' + minutes + ':' + seconds, '%m/%d/%Y %H:%M:%S') datetime.datetime(2009, 11, 28, 23, 59) 
+11
source share

All Articles