C# 14 · Async, errors and resources

Work with dates and times

DateOnly and TimeOnly model a date or a time of day on its own.

var today = DateOnly.FromDateTime(DateTime.UtcNow);
var nextWeek = today.AddDays(7);

Official C# 14 documentation

More async, errors and resources commands

All async, errors and resources commands · C# 14 cheatsheet

Was this page helpful?