What's The Current Day Number? - Epoch Converter

Today Saturday, March 7, 2026 is ...

Day 66

Day of the year is a number between 1 and 365 (in 2026), January 1 is day 1. After today 299 days are remaining in this year.

This page uses the ISO-8601 ordinal date format.

There is also another less-used format: the 'ISO day of year' numbers, this is a number between 1 and 371, day 1 of the year is Monday of the first ISO week (where the first Thursday of the new year is in week 1).

Lists of day numbers by year: 2025 - 2026 - 2027 - 2028 ...

Programming routines

Jumplist:

  • C#
  • C++
  • ColdFusion
  • Delphi
  • Go (golang)
  • Google Docs Spreadsheet
  • Java
  • JavaScript
  • LibreOffice Calc
  • LiveCode
  • Matlab
  • Microsoft Access
  • Microsoft Excel
  • MySQL
  • Objective C
  • Oracle
  • PERL
  • PHP
  • Powerbuilder
  • Powershell
  • Python
  • R
  • Ruby
  • T-SQL (Transact-SQL)
  • Unix/Linux
  • Visual Basic (VB.NET)

C#

int iDayOfYear = System.DateTime.UtcNow.DayOfYear;

C++

C++20, using the chrono library: #include <iostream> #include <chrono> int main() { auto now = std::chrono::system_clock::now(); std::chrono::year_month_day current_date{std::chrono::floor<std::chrono::days>(now)}; std::chrono::weekday today{std::chrono::sys_days{current_date}}; // ISO-8601 defines Monday as 1 and Sunday as 7. // c_encoding() returns 0 for Sunday, 1 for Monday... 6 for Saturday. // iso_encoding() returns 1 for Monday ... 7 for Sunday. unsigned int day_num = today.iso_encoding(); std::cout yday + 1; # ... or ... my $day_of_year = (localtime)[7] +1; # ... or (if you really want to use POSIX) ... use POSIX; my $day_of_year = POSIX::strftime("%j", time);

Replace time with other epochs for other days.

PHP

$dayNumber = date("z") + 1; You can use an epoch to find other day numbers: date("z", epoch) + 1 date("z") starts counting from 0 (0 through 365)!

Powerbuilder

Read the comment below by Danny Cruz.

Powershell

$DayOfYear = (Get-Date).DayofYear Write-Host $DayOfYear

Python

from datetime import datetime day_of_year = datetime.now().timetuple().tm_yday

R

format(Sys.Date(), "%j")

Ruby

time = Time.new puts time.yday

T-SQL (Transact-SQL)

SELECT DATEPART(DAYOFYEAR, SYSDATETIME()) or SELECT datediff(day,CAST(datepart(year,getdate()) AS CHAR(4)) + '-01-01',getdate()+1) AS number_of_today

Unix/Linux

date +%j

Visual Basic (VB.NET)

Dim dayOfYear As Integer = DateTime.Now.DayOfYear

Thanks to all the developers who contributed to this page! (read comments below)

Tag » What's The Number For June