What is the method used to calculate how many days there are between two dates?

The calculator above counts each day between the two dates. Even it takes into consideration leap years.