Skip to content

Instantly share code, notes, and snippets.

@renatogroffe
Created December 2, 2024 13:59
Show Gist options
  • Save renatogroffe/193b8e70fb79d9236829dbf2cbb11048 to your computer and use it in GitHub Desktop.
Save renatogroffe/193b8e70fb79d9236829dbf2cbb11048 to your computer and use it in GitHub Desktop.
List<Guid> guidsV7Utc = new();
for (int i = 1; i <= 5; i++)
{
var guid = Guid.CreateVersion7(DateTimeOffset.UtcNow);
guidsV7Utc.Add(guid);
Console.WriteLine($"{guid} - versao {guid.Version}");
Thread.Sleep(1000);
}
Console.WriteLine();
Console.WriteLine($"Guids V7 UTC: {JsonSerializer.Serialize(guidsV7Utc)}");
Console.WriteLine();
Console.WriteLine($"Guids V7 UTC - Order(): {JsonSerializer.Serialize(guidsV7Utc.Order())}");
Console.WriteLine();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment