in reply to Converting UNIX timestamp to datetime MYSQL

In addition to the foregoing, I find it very useful to employ Date::Manip::Objects as a sort of universal-toolkit for all things Date&Time.   A search of http://search.cpan.org for date and time is a very fruitful thing to do, because you will find a ready-made solution to just about anything in there. (DateTime::Calendar::Mayan, DateTime::Calendar::VikramaSamvata::Gujarati ... it’s actually fun to see all the things that people have come up with.)   Since date/time is a pretty universal PITA for computer programmers, everything about it has been thoroughly addressed ... which saves you a lot of (you guessed it!).