## calculate days between different da

## calculate days between different da

(OP)

calculate days between different date and time:

Please help me if anything wrong here:

Problem is here: e.g, test_dt=3/22/2017, test_tm=10:50:00; dx_dt=3/24/2017, dx_tm=9:45:00 but the result is 3.00 (days) not 2.96(days)

if( dx_tm>=test_tm, (daysafter( test_dt, dx_dt )) + ((secondsafter(test_tm, dx_tm)/3600))/24, ((daysafter( test_dt, dx_dt )) + (1-abs(secondsafter(test_tm, dx_tm)/3600))/24))

Appreciate your help!!

Please help me if anything wrong here:

Problem is here: e.g, test_dt=3/22/2017, test_tm=10:50:00; dx_dt=3/24/2017, dx_tm=9:45:00 but the result is 3.00 (days) not 2.96(days)

if( dx_tm>=test_tm, (daysafter( test_dt, dx_dt )) + ((secondsafter(test_tm, dx_tm)/3600))/24, ((daysafter( test_dt, dx_dt )) + (1-abs(secondsafter(test_tm, dx_tm)/3600))/24))

Appreciate your help!!

## RE: calculate days between different da

Matt

"Nature forges everything on the anvil of time"

www.anvil-of-time.com

## RE: calculate days between different da

SecondsAfter between the time, then convert the result back to days by dividing it by 86400. For example:

ldec_days = ((DaysAfter(test_dt, dx_dt) * 86400) + SecondsAfter(test_tm, dx_tm)) / 86400