Are you storing dates in MySQL using their timestamp column type? If so, that might be what is causing some confusion. A MySQL timestamp is not the same as a php timestamp. The conventional timestamp (aka unix timestamp) is a number of seconds. MySQL stores something else which is harder to work with in php.
So, assuming you are indeed using the MySQL timestamp, I would use the MySQL UNIX_TIMSTAMP() function to have your query return a php timestamp. Then using the date() and strtotime() functions with the php timestamp should get you going on the right track. strtotime() is one of the most versatile functions for manipulating dates.
-justin