Ext JS – Calculate Duration Between Two Dates

Ext JS – How to calculate duration between two dates in typical intervals such as years, months, days, hours, minutes or seconds.

The results for the first set of dates,
dt_1 = ‘2018-06-11 03:10:14 AM’
dt_2 = ‘2018-06-11 11:17:23 PM’

The results for the first set of dates,
dt_1 = ‘2018-06-11 03:10:14 AM’
dt_2 = ‘2018-06-11 11:17:23 PM’

0 Years
0 Months
0 Days
20 Hours
1207 Minutes
72429 Seconds

The results for the second set of dates,
dt_1 = ‘2017-06-11 03:10:14 AM’
dt_2 = ‘2018-06-19 11:17:23 PM’

1 Years
12 Months
373 Days
8972 Hours
538327 Minutes
32299629 Seconds

About the Author Teri

Leave a Comment: