The date at the end of the month is automatically adjusted for months with fewer than 31 days, including corrections for leap year.
Does that help?