in reply to unix time and dates with mysql

If I understand your question correctly:

The mySQL time type will not work for this purpose as it is used to store things that are just in h:m:s format, and won't store large enough times to be useful for dates. However the datetime type would work quite well, and mySQL will have an easy time comparing dates in this format. Example (I think this will work; I haven't tested it out):

$sth = $dbh->prepare('SELECT * FROM Table WHERE TimeCol >' . $dbh->quo +te($begin_time) . 'AND TimeCol <' . $dbh->quote($end_time))
where $begin_time and $end_time are strings of the format "YYMMDDHHMMSS"; the year and second can be filled in by your script so that you still only need to input the month, day, hour, and minute.