Calculate date differences and add/subtract days, weeks, months, or years
Calculate date differences and add or subtract time periods instantly with our free online date calculator. This tool helps project managers, planners, and anyone needing to calculate days between dates or find future/past dates by adding days, weeks, months, or years. Simply select your dates and get instant calculations.
Date calculator performs arithmetic operations on dates: add/subtract days, weeks, months, years, find differences between dates, calculate business days, and determine day of week. Essential for project planning, age calculations, deadline tracking, and scheduling applications.
Parse input dates into Date objects, then perform calculations using millisecond arithmetic or calendar-aware methods. For differences, subtract timestamps and convert to desired units. For additions, adjust date components while handling month/year boundaries.
JavaScript Date uses milliseconds since Unix epoch (Jan 1, 1970). Adding days: add 86400000ms per day. Months require calendar awareness (28-31 days). Business days exclude weekends and optionally holidays. Leap years: divisible by 4, except centuries unless divisible by 400.
Calculate deadlines and milestones from start date.
Start + 6 weeks = deadlineFind exact age in years, months, days.
Born 1990-05-15, Age: 34y 7m 15dCalculate working days between dates.
Dec 20 to Jan 5 = 10 business daysFind future occurrences of periodic events.
Every 2 weeks from today// Days between dates
function daysBetween(date1, date2) {
const ms = Math.abs(date2 - date1);
return Math.floor(ms / (1000 * 60 * 60 * 24));
}
// Add days/months/years
function addDays(date, days) {
const result = new Date(date);
result.setDate(result.getDate() + days);
return result;
}
function addMonths(date, months) {
const result = new Date(date);
result.setMonth(result.getMonth() + months);
return result;
}
// Business days (Mon-Fri)
function businessDaysBetween(start, end) {
let count = 0;
const current = new Date(start);
while (current <= end) {
const day = current.getDay();
if (day !== 0 && day !== 6) count++;
current.setDate(current.getDate() + 1);
}
return count;
}
// Calculate age
function calculateAge(birthDate) {
const today = new Date();
let years = today.getFullYear() - birthDate.getFullYear();
const monthDiff = today.getMonth() - birthDate.getMonth();
if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < birthDate.getDate())) {
years--;
}
return years;
}Core date calculation functions. Use Date methods for calendar-aware operations, millisecond math for fixed intervals.
Use date calculator for project planning, age calculations, scheduling, deadline tracking, and any date arithmetic needs.
Month additions preserve day-of-month when possible. Adding 1 month to Jan 31 gives Feb 28/29 (end of month). This is calendar-aware, not 30-day fixed.