SequentialGuid.NodaTime
5.0.7
dotnet add package SequentialGuid.NodaTime --version 5.0.7
NuGet\Install-Package SequentialGuid.NodaTime -Version 5.0.7
<PackageReference Include="SequentialGuid.NodaTime" Version="5.0.7" />
<PackageVersion Include="SequentialGuid.NodaTime" Version="5.0.7" />
<PackageReference Include="SequentialGuid.NodaTime" />
paket add SequentialGuid.NodaTime --version 5.0.7
#r "nuget: SequentialGuid.NodaTime, 5.0.7"
#:package SequentialGuid.NodaTime@5.0.7
#addin nuget:?package=SequentialGuid.NodaTime&version=5.0.7
#tool nuget:?package=SequentialGuid.NodaTime&version=5.0.7
SequentialGuid.NodaTime
NodaTime integration for the SequentialGuid library. Generate sequential UUIDs from NodaTime Instant, OffsetDateTime, and ZonedDateTime values, and extract embedded timestamps as Instant.
Install
dotnet add package SequentialGuid.NodaTime
Requires
NodaTime2.4.0 or later.
Features
| Feature | Description |
|---|---|
GuidV7.NewGuid(instant) |
Generate a UUIDv7 from an Instant, OffsetDateTime, or ZonedDateTime |
GuidV7.NewSqlGuid(instant) |
Same as above but with SQL Server byte ordering |
GuidV8Time.NewGuid(instant) |
Generate a UUIDv8 from an Instant, OffsetDateTime, or ZonedDateTime |
GuidV8Time.NewSqlGuid(instant) |
Same as above but with SQL Server byte ordering |
guid.ToInstant() |
Extract the embedded timestamp as a NodaTime Instant |
Quick Start
Generate UUIDs from NodaTime types
using NodaTime;
using SequentialGuid;
var now = SystemClock.Instance.GetCurrentInstant();
// UUIDv7 (millisecond precision) - recommended for most applications
var id = GuidV7.NewGuid(now);
// UUIDv8 (tick precision)
var id = GuidV8Time.NewGuid(now);
// SQL Server byte order variants
var sqlId = GuidV7.NewSqlGuid(now);
var sqlId = GuidV8Time.NewSqlGuid(now);
Generate from OffsetDateTime or ZonedDateTime
var offsetDt = new OffsetDateTime(
new LocalDateTime(2025, 7, 1, 12, 0, 0),
Offset.FromHours(-5));
var id = GuidV7.NewGuid(offsetDt);
var zonedDt = offsetDt.InZone(DateTimeZoneProviders.Tzdb["America/New_York"]);
var id = GuidV7.NewGuid(zonedDt);
Extract a timestamp as Instant
using NodaTime;
Guid id = GuidV7.NewGuid();
Instant? created = id.ToInstant();
// Returns the embedded UTC timestamp as an Instant, or null if not a sequential GUID
Supported Timestamp Types
All generation methods accept these NodaTime types:
| Type | Notes |
|---|---|
Instant |
Directly converted; most common usage |
OffsetDateTime |
Converted to Instant (for V8) or DateTimeOffset (for V7) |
ZonedDateTime |
Converted to Instant (for V8) or DateTimeOffset (for V7) |
Legacy API
The package also includes extension methods for the deprecated SequentialGuidGenerator and SequentialSqlGuidGenerator classes. These are marked [Obsolete] and will forward to GuidV8Time under the hood:
// Deprecated - use GuidV7/GuidV8Time directly instead
#pragma warning disable CS0618
var id = SequentialGuidGenerator.Instance.NewGuid(instant);
var sqlId = SequentialSqlGuidGenerator.Instance.NewSqlGuid(instant);
#pragma warning restore CS0618
Further Reading
See the main SequentialGuid README for full documentation on UUID generation, timestamp extraction, and SQL Server byte-order handling.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- NodaTime (>= 2.4.0)
- SequentialGuid (>= 5.0.7)
-
.NETStandard 2.0
- NodaTime (>= 2.4.0)
- SequentialGuid (>= 5.0.7)
-
net10.0
- NodaTime (>= 2.4.0)
- SequentialGuid (>= 5.0.7)
-
net8.0
- NodaTime (>= 2.4.0)
- SequentialGuid (>= 5.0.7)
-
net9.0
- NodaTime (>= 2.4.0)
- SequentialGuid (>= 5.0.7)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 5.0.7 | 31 | 3/21/2026 |
| 5.0.6 | 103 | 3/18/2026 |
| 5.0.5 | 72 | 3/17/2026 |
| 5.0.4 | 88 | 3/17/2026 |
| 5.0.3 | 88 | 3/13/2026 |
| 5.0.2 | 141 | 3/9/2026 |
| 4.0.6 | 1,488 | 2/19/2025 |
| 4.0.5 | 2,031 | 3/20/2024 |
| 4.0.4 | 9,287 | 2/27/2023 |
| 4.0.3 | 3,646 | 10/25/2022 |
| 4.0.2 | 597 | 10/20/2022 |
| 4.0.1 | 880 | 10/10/2022 |
| 4.0.0 | 630 | 10/5/2022 |
| 3.0.1 | 2,494 | 2/22/2022 |
| 3.0.0 | 958 | 9/15/2021 |
| 2.5.0 | 1,236 | 11/18/2020 |