E2E Forum › Modeling & Development › Determining number of days in month for date difference › Reply To: Determining number of days in month for date difference
in deed, date difference function does not return days for durations longer than 1 month. It is not very customizable.
You can achieve this by converting the dates in time ticks and calculating those values. Here the script to get number of days between 2 given dates:
local dif = date1.convertDateTimeToTimeTicks() - date2.convertDateTimeToTimeTicks(); set durationInDays = convertToFloat(dif / 86400);
86400 is the number of seconds of one day. With a different divisor, for instance 3600, you can calculate the difference in hours.