TYPE
DateOnly
Represents a Gregorian calendar date without time or offset. Available from .NET 6.
Formal Syntax & Structure
csharp syntaxcsharp
new DateOnly(year, month, day)Working Example
Example Snippetcsharp
var due = new System.DateOnly(2026, 2, 28);