When you print from Google App Engine datastore which have DateTimeProperty you see such as this:
Date: ’2008-10-10 16:40:25.126049’
You can convert this string directly to Datastore Datetime property with function below:
def convert_gae_datetime(self,gae_string_date):
datestr=gae_string_date.split(“.”)[0]
return datetime.strptime(datestr, “%Y-%m-%d %H:%M:%S”)