So the way to do this is by time.strftime("%Y-%m-%d", time.localtime(time.mktime(datetime.strptime("2012-03-09", "%Y-%m-%d").timetuple()))).
I didn't know strftime would turn the timetable to a string before I asked.
When I run time.mktime(datetime.strptime("2012-03-09", "%Y-%m-%d").timetuple())
I get the value 1331251200.0.
Now I want to know how can I invert this? So if I pass in 1331251200.0, how do I get as output 2012-03-09? I know strftime is the inverse of strptime, but I don't see how to invert the whole thing because of the timetable function.
How do I find the date string from the numeric value?