01-03-2016, 02:12 PM
Macro Macro2770
int spanDays
TimeSpanGetParts sub.DateIntToDateTime(160205)-sub.DateIntToDateTime(160103) spanDays
out spanDays
#sub DateIntToDateTime
function'DateTime dateInt
;dateInt - date in decimal format, like 160103 (2016-01-03)
;note: year must be 2-digit, assuming that the actual year is 2000-2099.
DateTime r.FromParts(dateInt/10000%100+2000 dateInt/100%100 dateInt%100)
ret r