年份天数计算器 — 查找儒略日数

This day of the year calculator instantly finds the ordinal day number (Julian Day Number) for any calendar date — from day 1 (January 1) to day 365 or 366 (December 31). It also shows how many days remain in the year, displays a year-progress bar, detects leap years, and lets you reverse-convert any day number back to a full calendar date. Enter a date below for instant results.

Date to Day of Year

Pick any date to find its ordinal day number (Julian Day Number) within the year.

Day of the Year

92

Day 92 of 365

Jan 125% of year elapsedDec 31
Day Number

92

of 365 total

Remaining

273

days left in year

Leap Year

No

365 days in year

Day Number to Date

Enter a year and an ordinal day number to find the corresponding calendar date.

常见问题

今天是一年中的第几天?

年内天数是当前日期在该历年中的序数。1 月 1 日是第 1 天,12 月 31 日是第 365 天(闰年第 366 天)。使用上方计算器,它会自动显示今天的天数。

什么是儒略日数?

在日历日期的语境中,儒略日数(也称序数日期)是从 1 到 365(闰年 366)的整数,表示日期在当年的位置。1 月 1 日 = 1,2 月 1 日 = 32,以此类推。不应将此与天文儒略日数混淆,后者从公元前 4713 年 1 月 1 日起计算天数。

如何手动计算年内天数?

将目标月份之前各月的总天数相加,再加上目标月份的天数。例如,非闰年 3 月 15 日:1 月(31)+ 2 月(28)= 59,加上 15 = 第 74 天。闰年中,3 月及之后的日期需加 1。

什么是 ISO 8601 序数日期格式?

ISO 8601 将序数日期表示为 YYYY-DDD,其中 DDD 是带前导零的三位年内天数。例如,2026 年 4 月 10 日为 2026-100。这种格式在计算、航空和物流中用于简化日期计算。

年内还剩多少天?

年内剩余天数等于该年总天数减去当前天数。非闰年(365 天)中,若今天是第 100 天,还剩 265 天。闰年(366 天)中,若今天是第 100 天,还剩 266 天。计算器会自动显示剩余天数。

如何将天数转换回日期?

从目标年份的 1 月 1 日开始,加上(天数 - 1)天。例如,2026 年第 100 天:从 2026 年 1 月 1 日加 99 天,得到 2026 年 4 月 10 日。使用本计算器的「天数转日期」功能即可即时反向查找。

闰年会改变年内天数吗?

是的。闰年中,2 月 29 日作为第 60 天插入。3 月 1 日及之后的所有日期的天数比普通年份的相同日历日期高出一个。12 月 31 日在闰年是第 366 天,而非第 365 天。

哪些年份是闰年?

能被 4 整除的年份是闰年,但世纪年必须同时能被 400 整除才是闰年。所以 2000、2004、2008……2024 年是闰年,但 1900 年和 2100 年不是。2024 年之后的下一个闰年是 2028 年。

How the Day of Year Calculator Works

Julian Day Number

The Julian Day Number (also called the ordinal date or day-of-year number) is a simple integer that counts the position of a date within its calendar year. January 1 is day 1, January 2 is day 2, and so on through December 31, which is day 365 in a common year and day 366 in a leap year.

This notation is widely used in astronomy, aviation, military logistics, and computing because it collapses a month-and-day pair into a single number, making date arithmetic simpler. The ISO 8601 standard formalises the ordinal date as YYYY-DDD — for example, April 10, 2026 is written as 2026-100.

Note:The term "Julian Day" also refers to the Julian Day Number used in astronomy, which counts days continuously from January 1, 4713 BC. The two systems are different; this calculator uses the ordinal day-of-year meaning, not the astronomical Julian Day Number.

How to Calculate the Day of Year

There are two common approaches to calculating the day-of-year number by hand:

Method 1 — Cumulative Month Totals

Sum the number of days in all months before the target month, then add the day of the month. For a leap year, add 1 for any date after February.

  1. Find the cumulative day count at the start of the target month (see the table below).
  2. Add the day of the month.
  3. If the year is a leap year and the month is March or later, add 1.
Example: March 15, 2026 (non-leap year)
Days before March = 31 (Jan) + 28 (Feb) = 59
Day of year = 59 + 15 = 74

Method 2 — Formula

For month M and day D in year Y:

N = floor(275 × M / 9) − floor((M + 9) / 12) × (1 + floor((Y − 4 × floor(Y / 4) + 2) / 3)) + D − 30

This formula handles leap years automatically and is used in some calendrical algorithms.

How This Calculator Works

The calculator subtracts January 1 of the selected year from the selected date in milliseconds, divides by 86,400,000 (milliseconds per day), applies Math.ceil(), and adds 1 to make January 1 equal to day 1. The reverse lookup sets the date to January 1 and then uses Date.setDate(n) to advance by the target ordinal number.

Monthly Day Ranges Table

The table below shows the first and last ordinal day number for each month. Values in parentheses apply to leap years (an extra day is added from March onward).

MonthDaysFirst DayLast Day
January31131
February28 (29)3259 (60)
March3160 (61)90 (91)
April3091 (92)120 (121)
May31121 (122)151 (152)
June30152 (153)181 (182)
July31182 (183)212 (213)
August31213 (214)243 (244)
September30244 (245)273 (274)
October31274 (275)304 (305)
November30305 (306)334 (335)
December31335 (336)365 (366)

Values in parentheses apply to leap years. A leap year has 366 days; all months from March onward are shifted by one compared to a common year.

Leap Years and Day Numbering

A year is a leap year if it is divisible by 4, except for century years, which must be divisible by 400. So 2000 and 2400 are leap years, but 1900 and 2100 are not.

Impact on Day of Year

In a leap year, February 29 is inserted as day 60. Every subsequent date in the year is one ordinal number higher than the same calendar date in a common year. December 31 becomes day 366 instead of day 365.

Practical Uses

Ordinal dates simplify date arithmetic: the number of days between two dates in the same year is just the difference of their day numbers. Cross-year calculations require knowing the total days in each intervening year, which depends on whether those years are leap years.