A birthday, a deadline, a flight and a log line all describe moments in time, yet each needs different arithmetic. Age counts calendar labels. Date differences count midnights. Time zone conversion maps an instant onto another clock. Unix timestamps flatten that instant into one integer. Mixing the models produces errors that look like bugs but are definition problems.
This guide connects the four time tools on Tool4SaaS: the age calculator, the date calculator, the time zone converter and the timestamp converter. Each section uses checked dates, so you can reproduce every result before trusting a form, invoice or schedule.
Why date math is harder than subtraction
Subtracting two dates looks like subtracting two numbers, but calendar dates are labels, not measurements. A month can hold 28, 29, 30 or 31 days. A year can hold 365 or 366. A day on a wall clock can last 23, 24 or 25 hours when daylight saving time changes. None of those variations appears in a plain “end minus start” calculation unless the software is told how to handle them.
The counting model also matters. If a project runs from January 1 to February 15, does it last 45 days or 46? Both answers can be defended. The interval contains 45 elapsed days, measured from the start of January 1 to the start of February 15. It touches 46 calendar dates if you count both the first and last day. Hotels, payroll systems and rental contracts choose different conventions, and the choice changes the number on the invoice.
Time zones add a third layer. An offset such as UTC−5 is not a property of a place. It is the result of a rule that can change at a legislated date. New York uses UTC−5 in winter and UTC−4 in summer. London uses UTC+0 and UTC+1 on different dates. A conversion that assumes one offset for the whole year will be an hour off for part of it, and an hour can move a meeting to the previous or next day.
Age is not a duration stored in years. It is a calendar difference in years, months and days, and month-end rules matter. A child born on January 31 turns one month old on February 28 in a common year, not on March 3. A person born on February 29 has a birthday label that many systems must decide how to handle. The arithmetic below keeps those rules visible.
Exact age: years, months and days
Start with the most common request: age on a specific date. Take a birth date of June 15, 1990 and a comparison date of October 22, 2026. Subtract the components in order, largest last:
- Days: 22 − 15 = 7.
- Months: 10 − 6 = 4.
- Years: 2026 − 1990 = 36.
The result is 36 years, 4 months and 7 days. That is a calendar age, not 36.3 years. To see why, add the parts back: 36 years after June 15, 1990 is June 15, 2026; 4 months after that is October 15, 2026; 7 days after that is October 22, 2026.
The component method only works while every subtraction stays at or above zero. Change the birth date to November 2, 1988 and the month step becomes 10 − 11 = −1. Borrow 12 months from the year column: 10 + 12 − 11 = 11 months, and the year count drops by one to 2026 − 1988 − 1 = 37. With days 22 − 2 = 20, the age is 37 years, 11 months and 20 days. Add it back and you land on October 22, 2026 again.
Total days are a separate calculation. From June 15, 1990 to June 15, 2026 is 36 × 365 = 13,140 days. The nine leap days in 1992, 1996, 2000, 2004, 2008, 2012, 2016, 2020 and 2024 add 9, for 13,149 days. June 15 to October 22, 2026 adds 15 days remaining in June, 31 in July, 31 in August, 30 in September and 22 in October: 129 days. The total is 13,278 days, which is 1,896 weeks and 6 days, or 318,672 hours.
Those totals suit forms that ask for age in months and milestone calculations. They are not interchangeable with the year-month-day label. Converting 13,278 days back to 36 years, 4 months and 7 days requires the calendar rules, not division by 365.
Date differences: elapsed days versus dates touched
For a project, a notice period or a billing cycle, the question is usually “how many days between these two dates?” Count midnights, not labels. From January 1, 2026 to February 15, 2026, January contributes 31 days to February 1, and February 1 to February 15 contributes 14: 45 elapsed days. In weeks, that is 6 weeks and 3 days. If you count both endpoints, the range covers 46 calendar dates.
Weekdays need their own pass because weekends are excluded. The same range starts on Thursday, January 1 and ends on Sunday, February 15. Monday-to-Friday days total 32 before public holidays are removed. A payroll system that pays for 32 days and a leave policy that counts 46 calendar days are both correct for their own definitions, which is why the definition belongs in the request.
Leap days change short intervals. From February 28, 2024 to March 1, 2024 is 2 days because February 29 sits between them. The same pair of dates in 2023 is 1 day. A date calculator that treated every February as 28 days would lose a day from every interval that crosses the 29th.
| Question | Counting model | Example | Result |
|---|---|---|---|
| Exact age | Calendar years, months and days | 1990-06-15 to 2026-10-22 | 36y 4m 7d; 13,278 days |
| Age gap | Calendar difference between birth dates | 1988-11-02 to 1992-03-14 | 3y 4m 12d; 1,228 days |
| Days between | Elapsed midnights | 2026-01-01 to 2026-02-15 | 45 days; 6w 3d |
| Add an offset | Calendar days or months | 2026-01-01 + 40 days | 2026-02-10 |
| Time zone conversion | Instant and zone rule | 2026-03-10 15:00 New York | 2026-03-11 04:00 Tokyo |
| Unix timestamp | Seconds from 1970-01-01 UTC | 1,700,000,000 | 2023-11-14 22:13:20 UTC |
The table is a map, not a formula sheet. The cluster guides cover each row’s traps in detail.
Adding and subtracting days, weeks and months
Adding days is simplest because a day is a calendar unit, not a 24-hour block. Add 40 days to January 1, 2026: January has 31 days, so 30 days after January 1 is January 31, and 10 more days lands on February 10, 2026. Clock changes do not alter the result, because the target is a date label rather than a duration.
Adding months is not the same as adding 30 days. One month after January 31, 2026 is February 28, 2026, because February has 28 days and the target is clamped to its last day. In 2024, the same operation gives February 29. One month after March 31 is April 30. This clamping rule is standard in calendar libraries and in contract wording, but it must be applied consistently.
Subtracting crosses boundaries in the same way. Ten days before January 5, 2026 is December 26, 2025: five days bring you to December 31, and five more enter December. If you instead subtract 240 hours from a timestamp, a daylight saving change inside the interval can shift the wall-clock result by an hour. Decide whether the question is about a date or an instant before choosing the method.
Recurring schedules add another wrinkle. A monthly subscription that starts on the 31st needs an explicit month-end policy, because February, April, June, September and November cannot supply a 31st. Most billing systems clamp to the last day of the shorter month. A few roll forward to the first of the next month. Both behaviors exist; neither is universal.
Time zones: one instant, many clocks
A time zone is a set of rules attached to a place, not a fixed number attached to a city. The rules include the standard offset, the daylight saving dates and any historical changes. New York observed daylight saving time in 2026 from March 8 to November 1. London switched on March 29 and back on October 25. Because the switch dates differ, the gap between the two cities is four hours for three weeks each spring, not the usual five.
Convert through UTC to keep the arithmetic honest. A meeting at 15:00 on March 10, 2026 in New York is 19:00 UTC, because New York is on EDT at UTC−4. Tokyo is on JST at UTC+9 with no daylight saving change, so add 9 hours to 19:00 UTC for 04:00 on March 11 in Tokyo. The date moved forward because the sum passed midnight UTC.
Six months later the same wall-clock time produces a different result. On December 15, 2026, New York is on EST at UTC−5. 15:00 becomes 20:00 UTC, and Tokyo receives 05:00 on December 16. The local meeting time did not change; the offset did. This is why a recurring “3 p.m. New York” series drifts by an hour for the Tokyo participant after a switch.
Two daylight saving edge cases break naive converters. On March 8, 2026, clocks in New York jump from 02:00 to 03:00, so 02:30 does not exist. On November 1, 2026, clocks fall back from 02:00 to 01:00, so 01:30 occurs twice. A converter must choose an offset or reject the input for the first case, and must label which occurrence it used for the second. Schedules built on local wall-clock strings cannot resolve that ambiguity without an explicit offset or a UTC anchor.
The safe pattern for distributed teams is to store the instant in UTC, display it in each participant’s zone, and include the zone name and offset in the invitation. “15:00 America/New_York (UTC−4)” is unambiguous. “3 p.m. EST” is not, because the abbreviation is sometimes used loosely in summer, and “IST” can mean India, Ireland or Israel.
Unix timestamps: one integer, one instant
Unix time counts seconds from 1970-01-01 00:00:00 UTC. The value 1,700,000,000 corresponds to 2023-11-14 22:13:20 UTC. In New York, which was on EST at UTC−5 on that date, the same instant is 17:13:20. In Kolkata, at UTC+5:30, it is 03:43:20 on November 15. In Tokyo, at UTC+9, it is 07:13:20 on November 15. One integer, three local readings, three different dates or times.
The unit is the most common source of bugs. JavaScript’s Date.now() returns milliseconds, so the same instant appears as 1,700,000,000,000, a 13-digit number. A ten-digit value is almost always seconds; a thirteen-digit value is almost always milliseconds. Multiplying or dividing by 1,000 at the wrong point shifts the date by decades, not by a small rounding error.
Useful anchors: 0 is 1970-01-01 00:00:00 UTC. −86,400 is 1969-12-31 00:00:00 UTC. 1,735,689,600 is 2025-01-01 00:00:00 UTC. 1,792,627,200 is 2026-10-22 00:00:00 UTC. If a log entry shows a number near 1.79 billion, it is a 2026 date in seconds; if it shows 1.79 trillion, it is the same date in milliseconds.
Unix time ignores leap seconds. The system pretends every day has exactly 86,400 seconds, so a leap second inserted at the end of a day is not represented as a distinct value. For scheduling, logging and most application logic this simplification is fine. For astronomical timing or leap-second-aware protocols, a Unix timestamp is not a complete record of elapsed SI seconds.
Leap years and February 29
The Gregorian rule is short: a year is a leap year if it is divisible by 4, except that century years are not leap years unless they are divisible by 400. So 2024 and 2028 are leap years, 2026 is not, 2000 is a leap year, and 2100 is not. The rule keeps the calendar aligned with the seasons over centuries.
A February 29 birthday has two separate questions. The elapsed-day count is unambiguous: from February 29, 2000 to October 22, 2026 is 9,732 days. The year-month-day label depends on the convention for the missing date. If the birthday is observed on February 28, the label is 26 years, 7 months and 24 days. If it is observed on March 1, the label is 26 years, 7 months and 21 days. Both describe the same number of midnights crossed.
Legal and administrative conventions vary by country and by purpose. Some documents treat March 1 as the anniversary in common years; others use February 28. The practical rule is to pick the convention your jurisdiction or form expects, write it down, and apply it consistently. The leap year birthday guide covers the legal and scheduling variations in more detail.
Leap days also affect date arithmetic that has nothing to do with birthdays. One-year terms show the leap day: March 1, 2023 to March 1, 2024 spans 366 days because February 29, 2024 falls inside, while March 1, 2024 to March 1, 2025 spans 365. An annual interest calculation that divides by 365 will differ by one day’s worth of interest between the two periods. The convention should be stated in the contract, not assumed by the spreadsheet.
Which guide and tool to use
The eight cluster guides follow the questions people actually ask. Start with the one that matches your wording, then use the linked tool to check the result:
- How to calculate exact age — the borrow method with three checked birth dates.
- Age difference between two dates — comparing siblings, colleagues or records.
- Date difference calculation — elapsed days, weeks, months and working days.
- Time zone conversion — DST-aware meeting scheduling.
- Unix timestamp conversion — seconds, milliseconds and ISO strings.
- Leap year birthdays — February 29 conventions and century rules.
- Add and subtract dates — offsets, month-end clamping and deadlines.
- Age in days, hours and minutes — total-unit conversions and milestones.
Use the age calculator when the input is a birth date and the output is an age. Use the date calculator when the input is two dates or a date and an offset. Use the time zone converter when the input is a meeting time in a named zone. Use the timestamp converter when the input is an integer from a log, an API or a database. Choosing the right input model removes most of the ambiguity before any arithmetic begins.
Mistakes that survive a second look
- Treating a month as 30 days. One month after January 31 is February 28 or 29, not March 2. Calendar months clamp to the target month’s last day.
- Mixing inclusive and exclusive counts. A 45-day interval covers 46 dates if both endpoints count. State the convention before comparing two systems.
- Assuming today’s offset applies all year. New York, London, Sydney and most of Europe change offsets. Always resolve the offset at the specific instant.
- Adding offsets in the wrong direction. To convert 15:00 EDT to UTC, add 4 hours; to convert UTC back to EDT, subtract 4. The sign follows the offset, not the direction of travel.
- Confusing seconds with milliseconds. Ten digits versus thirteen. A timestamp near 1.79 billion is seconds; near 1.79 trillion is milliseconds.
- Ignoring the time of birth. A person born at 23:30 on June 15 is not yet 36 years and 4 months old at 09:00 on October 22. Date-only calculators drop the time, which suits forms but not precise legal deadlines.
- Using ambiguous abbreviations. CST can mean US Central, China Standard or Cuba Standard. Use IANA names such as America/Chicago, Asia/Shanghai or America/Havana.
A final sanity check works for every row in the table: convert the result back. Add the age components to the birth date and see whether you land on the comparison date. Add the day count to the start date and see whether you reach the end date. Convert the local time back to UTC and compare. If the reverse operation does not return the original, the definition changed somewhere in the middle.