How we calculate
DaysLeftly answers date and time questions with numbers worked out by code, not typed in by hand. This page explains exactly how each kind of answer is calculated, so you can check any result yourself.
How the pages are made
Every page is built from a template written by Vijay Jadhav, the person behind DaysLeftly. The template holds the wording, the layout and the rules; the numbers on each page are calculated by code from the calendar. The site is rebuilt every night so the server's copy shows the current date, and your browser recalculates every number when the page opens, so the answer is right for your own time zone.
We test the calculations by comparing two separate versions of the code, one that runs on our server and one that runs in your browser, across thousands of random dates, including leap days and dates hundreds of years apart. A page only goes live when both agree. Pages are added a few at a time, and each one is chosen because people search for that exact question.
Counting days
- Days until a date does not count today. If today is Monday, Wednesday is 2 days away.
- Days since a date counts the date itself as day zero, so yesterday is 1 day ago.
- Days between two dates counts from the start date up to the end date, without the end date, like most spreadsheets. The date duration calculator has an option to include the end date.
- Weeks are always seven days. We show whole weeks plus the days left over.
- Months follow the calendar: one month after January 15 is February 15. If the target month is shorter, the date moves to that month's last day, so one month after January 31 is February 28, or 29 in a leap year.
- Weekends count each Saturday between two dates, and working days count Monday to Friday. Public holidays are not taken off, because they differ by country.
Today, time zones and the countdown clock
"Today" means today where you are. Your browser supplies the date, so the count changes at your midnight, not ours. The live clock on countdown pages counts to midnight at the start of the target day, in your time zone. That is why a countdown can show "3 days 04:35" while the calendar count says 4 days: the calendar count is whole days from today's date.
Week numbers
Week numbers follow the international standard ISO 8601: weeks start on Monday, and week 1 is the week that contains the first Thursday of the year. Some years therefore have 53 weeks. Our guide on ISO week numbers explains this in detail.
Holidays and seasons
- Fixed-date holidays, such as Christmas (December 25) and Halloween (October 31), use their set date each year.
- Rule-based holidays use their official rule, for example US Thanksgiving on the fourth Thursday of November and Labor Day on the first Monday of September.
- Easter is calculated with the standard Western (Gregorian) method, and related days such as Good Friday are counted from it.
- Seasons use the astronomical dates of the equinoxes and solstices in the Northern Hemisphere.
- Lunar and lunisolar holidays, such as Diwali, Ramadan, Eid and Chinese New Year, follow published calendars. Some depend on sighting the moon, so the date can differ by a day between countries. We mark these as estimates.
Ages and birthdays
Ages are counted the usual way: whole years first, then whole months, then the days left over. For people born on February 29, birthdays in common years are counted on February 28. "How old is someone born in" a given year gives two ages, depending on whether that person's birthday has passed yet this year.
Times
Hours pages use your device's clock and time zone. Military time is the 24-hour clock written as four digits: 1900 is 7:00 PM. The hours calculator treats an end time earlier than the start time as an overnight shift.
Found a mistake?
Please email hello@daysleftly.com with the page link and the answer you expected. We check every report and fix confirmed errors quickly.