If current year is a leap year, the algorithm assumes that all previous years are leap years:
if is_leap_year; then
year_seconds=$(( 366 * $days_seconds ))
else
year_seconds=$(( 365 * $days_seconds ))
fi
# […]
elapsed_years=$(( $elapsed_seconds / $year_seconds ))
If current year is a leap year, the algorithm assumes that all previous years are leap years: