Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Time span in days (int)
#5
Macro Macro2770
Code:
Copy      Help
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


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)