Bob Pusateri gives us a few techniques for calculating the last day of a particular month:
Months are funny. Unlike other parts of a date, they vary in length:
- The last second of a minute is always 59.
- The last minute of a hour is always 59.
- The last hour of a day is always 23.
But the last day of a month? Well that depends on what month it is. And the year matters too because a leap year means February gets an extra day.
Click through for several techniques, including the knuckle technique for advanced practitioners. But what if I need to calculate the end of a lunar month?