I have a query that returns a date time in sql, example:
+---------------------+
| created |
+---------------------+
| 2008-07-31 21:42:52 |
+---------------------+
In my python code I am doing the following to capture the data by calling the query. Here is my python code:
query_item_created_f = None
query_item_created_f = query_item_created.format(parent_id=question_id)
self.dbCursor.execute(query_item_created_f)
created_date = self.dbCursor.fetchall()
print created_date
I get the data and time in following format:
({'created': datetime.datetime(2008, 7, 31, 21, 42, 52)},)
How can I change this to unix data time?