What day of the year is it?
The day number, days left in the year and whether it is a leap year. It follows your timezone, and you can look up any date.
Enter a year and a day number to get the date.
What day of the year is it?
The big number is the ordinal day: 1 January is day 1, and 31 December is day 365, or day 366 in a leap year. It uses the date in the timezone you pick, so it changes at local midnight. Choose another date to look up its day number, or use the second box to go the other way, from a day number to a calendar date.
Leap years
A year is a leap year if it divides by 4, except years that divide by 100, unless they also divide by 400. So 2000 and 2024 were leap years, 1900 and 2100 are not. The next leap years are 2028, 2032, 2036, 2040, 2044. In a leap year, 29 February is day 60 and every later date is one day further along: 1 March is day 60 in a common year and day 61 in a leap year.
Day of the year, and days left, by year
Each year page has every date with its day number, ISO week and Unix start time: 2026 · 2027 · 2028 · 2029.
Get the day of the year in code
JavaScript
const d = new Date();
const dayOfYear = Math.floor((Date.UTC(d.getFullYear(), d.getMonth(), d.getDate())
- Date.UTC(d.getFullYear(), 0, 0)) / 86400000);
Python
from datetime import date
date.today().timetuple().tm_yday
PostgreSQL
SELECT EXTRACT(DOY FROM CURRENT_DATE);
MySQL
SELECT DAYOFYEAR(CURDATE());
Bash (GNU or BSD date)
date +%j # 001 to 366
Java, Go, PHP, Ruby
LocalDate.now().getDayOfYear() // Java
time.Now().YearDay() // Go
date('z') + 1; // PHP: z counts from 0
Date.today.yday // Ruby
Related: week number, time difference, date to timestamp.
Last updated: