LaravelRUS / localized-carbon

A localizable version of Carbon
138 stars 62 forks source link

Wrong calculations on big dates diffs! #43

Closed smgladkovskiy closed 9 years ago

smgladkovskiy commented 9 years ago

When trying to make diff dates with big delta, user faced with wrong calculations. For example diff with dates 01.01.1974 and now (20.01.2015) is showing 44 years. Obviously it is wrong because diff is 41 years.

4 weeks per month is does its work!

Average number of weeks in a year is 4.35: 365 days in a year, 12 months, 7 days in a week, 365/12/7 = 4.345238095238095. 4.35 is good enough for big time calculations! If this parameter is used - everything is calculates with excellent accuracy!