python timedelta get days with fraction

Solutions on MaxInterview for python timedelta get days with fraction by the best coders in the world

showing results for - "python timedelta get days with fraction"
Raphael
19 Mar 2020
1from datetime import timedelta
2
3def get_days_between(datePast, dateFuture):
4   difference = dateFuture - datePast
5   return difference.total_seconds() / timedelta(days=1).total_seconds()