Home

yearday

Yearday is a term used in calendrical and data-processing contexts to denote the ordinal position of a day within a calendar year. It ranges from 1 to 365 in common years and from 1 to 366 in leap years. The concept is equivalent to an ordinal date, and in ISO 8601 it is often written as YYYY-DDD, where DDD is the day of the year, ranging from 001 to 366.

To determine a yearday, one must know whether the year is a leap year and then sum

Common examples include January 1 being yearday 1, and December 31 being yearday 365 in non-leap years

Uses of yearday include data logging, meteorology, astronomy, and software development, where a simple, month-independent count

Limitations include its readability for human users and the need to correctly handle leap years. When presenting

the
days
in
the
months
preceding
the
given
date,
adding
the
day
of
the
month.
In
the
Gregorian
calendar,
leap
years
occur
every
year
divisible
by
4,
except
that
years
divisible
by
100
are
not
leap
years
unless
they
are
also
divisible
by
400.
or
366
in
leap
years
(for
example,
2020-366
corresponds
to
December
31,
2020).
of
days
facilitates
storage,
sorting,
interval
calculations,
and
cross-year
comparisons.
Storing
or
exchanging
dates
as
year
plus
yearday
can
be
advantageous
in
systems
with
fixed-width
fields
or
where
human-friendly
month
names
are
unnecessary.
information
to
people,
yearday
values
are
often
converted
back
to
conventional
month-day
formats
to
aid
comprehension.