Adding or subtracting a few days from today's date seems simple, but date math can get incredibly complex when you start crossing month boundaries, accounting for leap years, and adjusting for time zones.
Introduction to Date Math
Our calendar system (the Gregorian calendar) is notoriously irregular. We have 12 months, but they are not all the same length. February is particularly tricky, as it changes length every four years.
Adding Days and Weeks
Adding exactly 7 days (or 1 week) is straightforward because weeks always have 7 days. However, adding 30 days is NOT the same as adding 1 month. Depending on the month you start in, adding 30 days might push you into the next month early, or leave you a day short.
Want to jump forward or backward in time?
Use our calculator to add or subtract days, weeks, months, or years without worrying about leap years or month lengths.
Open Date CalculatorThe Complexity of Adding Months
When software engineers build systems to add 1 month to a date, they usually increment the month value while keeping the day the same (e.g., Jan 15th + 1 month = Feb 15th). But what happens if you add 1 month to January 31st?
February 31st does not exist. Standard logic dictates that the date snaps to the last valid day of the target month (February 28th, or February 29th in a leap year). Because of these edge cases, it is highly recommended to use automated tools rather than guessing.