SYNOPSIS
n = date:daysTo(ref)
DESCRIPTION
Calculates the difference in days between two date values.
RETURN VALUE
The time difference between ref and date in days.
ERRORS
Raises an error if time or ref is not a date instance.
EXAMPLE
>
>
>
d1 = clock.newDate(1990, 1, 1)
d2 = clock.newDate(1991, 1, 1)
print (d1:daysTo(d2))
365