Created
March 1, 2025 14:49
-
-
Save renatogroffe/d585afa559869d1463bf18ffc8f252e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Globalization; | |
using System.Runtime.InteropServices; | |
Console.WriteLine("***** Testes com .NET 10 | Novos overloads na classe estatica ISOWeek *****"); | |
Console.WriteLine($"Versao do .NET em uso: {RuntimeInformation | |
.FrameworkDescription} - Ambiente: {Environment.MachineName} - Kernel: {Environment | |
.OSVersion.VersionString}"); | |
var currentDate = DateOnly.FromDateTime(DateTime.Now); | |
Console.WriteLine(); | |
Console.WriteLine($"Data atual: {currentDate}"); | |
Console.WriteLine($"Semana do ano: {ISOWeek.GetWeekOfYear(currentDate)}"); | |
Console.WriteLine($"Ano: {ISOWeek.GetYear(currentDate)}"); | |
var firstFriday2025 = ISOWeek.ToDateOnly(2025, 1, DayOfWeek.Friday); | |
Console.WriteLine($"Primeira sexta-feira de 2025: {firstFriday2025}"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment