in reply to Converting from Date Time to Unix Time

Just to add my own wrinkle to this issue - you can convert to Unix time directly in your SQL query:
select datediff(ss, 'jan 1 1970', datetime_column) from ...
That will return a unix time value that assumes that the database server runs in the GMT (or UTC) timezone, which it probably doesn't.

You can convert the $time value from this expression to the real Unix time value for your timezone with:

use Time::Local; $time = timelocal(gmtime($time_from_database));
OK - so it's not the simplest way to do this - however it's good to be aware of what you can do at the database level. :-)

Michael