Every timer and calculator on this site follows the rules below. They run in your browser, and the code is one small file you can read.
Timers and the stopwatch
When you press Start, the page records the exact moment the timer should end (or, for the stopwatch, the moment it started) using your device's clock. Each refresh then compares the clock with that moment. Nothing is counted tick by tick, so a background tab, a busy computer or a laptop lid closed for a minute does not make the timer drift. The display updates about four times a second; the stopwatch twenty times a second and shows hundredths.
The alarm is a tone generated in the browser. There is no audio file, and the sound plays only after you have interacted with the page, which is a browser rule. If your device is muted you will still see the flashing tab title and the red clock.
A running timer stores its end time in your browser for that tab only, so reloading the page picks it up again. Closing the tab clears it.
Typing a time
5 means five seconds. 5:00 means five minutes. 1:30:00 is an hour and a half, as is 1h 30m or 90m. Clock times accept 9:00, 9:00 am, 17:30 and 1730.
Days between dates
Dates are treated as calendar days of exactly 24 hours, so a day never has 23 or 25 hours because of daylight saving. The result is the difference: Monday to Friday is 4 days. Turn on "count the end date too" to get 5.
The breakdown into years, months and days steps forward from the start date in whole calendar months as far as it can without passing the end date, then counts the days left. That is why January 31 to March 1 is 1 month and 1 day: January 31 plus one month lands on February 28, and March 1 is one day later.
Adding to a date
Years and months are added first, clamping to the end of the month when needed (January 31 plus one month is February 28, or February 29 in a leap year). Weeks and days are then added as exact multiples of 24 hours. Leap years are every fourth year, except century years not divisible by 400: 2024 and 2028 are leap years, 2100 is not.
Business days
Monday to Friday count. Saturdays, Sundays and any dates you list as holidays do not. Counting starts the day after the start date, so Friday to Monday is one business day. No holiday calendar is built in, because public holidays differ by country, region and employer, and a wrong assumption is worse than none.
Age
Age is whole years first, then the remaining whole calendar months, then days, using the same step-forward rule as above. The next-birthday countdown uses the birthday in the current year if it has not yet passed, otherwise next year's. A February 29 birthday falls on March 1 in years without a leap day.
Week numbers
Week numbers follow ISO 8601: weeks start on Monday, and week 1 is the week containing the year's first Thursday. So January 1 can be in week 52 or 53 of the previous year, and some years have 53 weeks.
Time arithmetic
Times are converted to seconds, added or subtracted, and converted back, so 1:30 plus 0:45 is 2:15 rather than 1:75. Decimal hours are minutes divided by 60: 7:30 is 7.5 hours. The time between two clock times rolls over midnight when the end is earlier than the start, so 22:00 to 06:00 is 8 hours.
Military time
PM hours other than 12 gain 12 (2:30 PM is 1430). 12 AM is 0000 and 12 PM is 1200. The 24-hour clock used in most of the world is the same numbers with a colon.
Time zones
Zone rules, including daylight saving dates, come from the time zone database built into your browser, keyed by place names such as America/New_York rather than abbreviations. A wall-clock time in the "from" zone is resolved to a single instant, then displayed in every other zone. UTC never observes daylight saving and is the reference.
Unix time
Seconds since 1970-01-01 00:00:00 UTC, ignoring leap seconds. Ten-digit numbers are read as seconds and thirteen-digit numbers as milliseconds. A timestamp has no time zone; the local time shown uses your device's zone.
Checking the code
All of this lives in /source/time.js, and each rule has an automated test. If a result looks wrong, tell us with the inputs you used.