These functions return an integer that represents the number of either days or seconds between two times.
days_between(later_time, earlier_time)
seconds_between(later_time, earlier_time)
For the days_between function, the passed times are truncated before the returned interval is calculated. For example, the difference between 8/10/1990 23:59:59 and 8/11/1990 0:0:0 is 1 second, but days_between returns a difference of one day. If your application needs more than plus-or-minus 24 hours accuracy, use the seconds_between function and then convert the returned number of seconds to the time unit that you need.