New(ish) DateOnly Type in .NET 6 (C# 10)

  Рет қаралды 448

Deborah Kurata

3 ай бұрын

There are times we want a date in our C# applications. Not a date with a time, just a date. Like a birth date or anniversary or hire date.
In this video, we walk through the new(ish) DateOnly data type that was introduced in .NET 6. We examine its benefits, and look at several ways that DateOnly can simplify our code.
*Links*
Sample code: github.com/DeborahK/CSharp-Examples/tree/main/dates
*Content*
00:00 Newish DateOnly Type in .NET 6 (C# 10)
00:27 Using DateTime
00:58 Target-typed new expression
01:42 Viewing the DateTime
02:04 Using DateOnly
02:25 Benefits of DateOnly type
03:10 Getting the current date as DateOnly
03:31 Calculating the number of days between two dates (DayNumber)
04:17 Wrap up
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
😊About Me
Hey! I'm Deborah Kurata
I'm a software developer and KZbin content creator. I speak at conferences such as VS Live and ng-conf. I write articles for freeCodeCamp. And I'm a Pluralsight author with courses in the top 10 most popular (out of 10,000+) over the past 5 years. For my work in support of software developers, I've been recognized with the Microsoft Most Valuable Professional (MVP) award, and I'm a Google Developer Expert (GDE).
Contact me on Twitter: DeborahKurata
Find my Pluralsight courses: www.pluralsight.com/profile/author/deborah-kurata
Access my freeCodeCamp articles: www.freecodecamp.org/news/author/deborah-kurata/
View my KZbin content: www.youtube.com/@deborah_kurata
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
#csharp
#csharptutorial
#dateonly
#dateonlytypein.net6
#dateonlytypeincsharp
#datein.net6
#.net6dateonlytype
#dateonlyincsharp
#dateonlyincsharp10
#csharpdateonly
#dateonlytypemappinginsqlserver
#datetimetodateonlyincsharp10
#csharpdateonlytype
#dateenhancementsin.net6
#csharp10dateonlytype

Пікірлер