01-03-2016, 10:53 AM
Quote:I wonder whether there exists a fast wayNo.
One of ways:
Macro Macro2766
int d1=(16<<16) | (1<<8) | 3 ;;date 16-01-03 -> 0x100103
int d2=d1+5 ;;+ 5 days
int spanDays
TimeSpanGetParts sub.DateIntToDateTime(d2)-sub.DateIntToDateTime(d1) spanDays
out spanDays
#sub DateIntToDateTime
function'DateTime dateInt
;note: year must be 2-digit, assuming that the actual year is 2000-2099.
DateTime r.FromParts(dateInt>>16&255+2000 dateInt>>8&255 dateInt&255)
ret r