in reply to DATE TIME Manipulation

Check the mysql docs for the mysql from_unixtime() function. It'll take a time_t/epoch seconds value like time() produces and turn it into something more to mysql's liking.