Results for “month”
Small, practical examples. Search by task or narrow things down below.
Find the final day of a month
JavaScript: Day zero of the following UTC month selects the previous month’s final day.
JavaScript✓ Tested
Find the final day of a month
TypeScript: Day zero of the following UTC month selects the previous month’s final day.
TypeScript✓ Tested
Find the final day of a month
Use EOMONTH without manually calculating month length.
EOMONTH✓ Tested
Find the first day of a month
Round a date to its calendar month boundary.
date✓ Tested
Find the last day of a month
Java: Use YearMonth so leap years and month lengths are handled by the calendar library.
Java✓ Tested
Find the length of a calendar month
C#: DaysInMonth applies the Gregorian leap-year rules.
C#✓ Tested
Find the number of days in a month
Python: Use calendar.monthrange to account for leap years.
Python✓ Tested
Find the number of days in a month
PowerShell: DaysInMonth handles leap-year February correctly.
PowerShell✓ Tested
Round a timestamp down to its month
Group dates by a calendar boundary.
date_trunc✓ Tested
Add calendar days in UTC
JavaScript: Use UTC date setters to cross month boundaries without local daylight-saving effects.
JavaScript✓ Tested
Add calendar days in UTC
TypeScript: Use UTC date setters to cross month boundaries without local daylight-saving effects.
TypeScript✓ Tested
Advance a date by a number of days
Python: Use timedelta so month and year boundaries are handled automatically.
Python✓ Tested