C#DateTimeDayOfYear

Gets the day of the year represented by this instance.

Syntax

dt.DayOfYear

Example

Enter values below to update the example in real time.

dt
new
Console
WriteLine
DateTime dt = new DateTime(2024, 6, 15);
Console.WriteLine(dt.DayOfYear);   // 167