you could try using the sql to_days(date) function, which returns the number of days from the current date until 'date'.
the date /can/ be a timestamp, but i don't know if the function will be happy returning a negative number or not ;-) you'll just have to suck it and see :-)
failing this try some expression involving the from_unixtime() sql function.
--
rad