Soenneker.Enums.UnitOfTime
4.0.602
Prefix Reserved
dotnet add package Soenneker.Enums.UnitOfTime --version 4.0.602
NuGet\Install-Package Soenneker.Enums.UnitOfTime -Version 4.0.602
<PackageReference Include="Soenneker.Enums.UnitOfTime" Version="4.0.602" />
<PackageVersion Include="Soenneker.Enums.UnitOfTime" Version="4.0.602" />
<PackageReference Include="Soenneker.Enums.UnitOfTime" />
paket add Soenneker.Enums.UnitOfTime --version 4.0.602
#r "nuget: Soenneker.Enums.UnitOfTime, 4.0.602"
#:package Soenneker.Enums.UnitOfTime@4.0.602
#addin nuget:?package=Soenneker.Enums.UnitOfTime&version=4.0.602
#tool nuget:?package=Soenneker.Enums.UnitOfTime&version=4.0.602
Soenneker.Enums.UnitOfTime
A string-backed enum-value type for carrying a duration or calendar-period unit through application and API contracts.
Install
dotnet add package Soenneker.Enums.UnitOfTime
Usage
using Soenneker.Enums.UnitOfTime;
UnitOfTime unit = UnitOfTime.Minute;
string wireValue = unit.Value; // "Minute"
if (UnitOfTime.TryFromValue(input, out UnitOfTime? parsed))
{
unit = parsed;
}
Available values:
- Subsecond:
Tick(100 nanoseconds),Nanosecond,Microsecond,Millisecond - Clock units:
Second,Minute,Hour - Larger periods:
Day,Week,Month,Quarter,Year,Decade
System.Text.Json serializes the type as the shown string value and restores recognized values to the shared static instances. FromValue throws for unknown input; use TryFromValue when parsing configuration or requests. FromName and TryFromName are also generated.
This package identifies a unit; it does not convert values, calculate a duration, or apply calendar arithmetic. Months, quarters, years, and decades vary by reference date, while a calendar day can differ from 24 elapsed hours across time-zone transitions. The consuming API must state whether Day and Week mean fixed elapsed durations or calendar periods, define its time zone, and use a numeric type with sufficient range and precision.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- Soenneker.Attributes.PublicOpenApiObject (>= 4.0.52)
- Soenneker.Gen.EnumValues (>= 4.0.46)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Soenneker.Enums.UnitOfTime:
| Package | Downloads |
|---|---|
|
Soenneker.Extensions.DateTime
A collection of helpful DateTime extension methods |
|
|
Soenneker.Extensions.DateTimeOffsets
A collection of helpful DateTimeOffset extension methods |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.602 | 2,837 | 8/30/2026 |
| 4.0.601 | 1,736 | 8/30/2026 |
| 4.0.600 | 76 | 8/30/2026 |
| 4.0.599 | 84 | 8/30/2026 |
| 4.0.598 | 416 | 8/29/2026 |
| 4.0.597 | 6,654 | 8/21/2026 |
| 4.0.596 | 2,349 | 8/18/2026 |
| 4.0.595 | 93 | 8/18/2026 |
| 4.0.594 | 766 | 8/18/2026 |
| 4.0.593 | 5,032 | 8/7/2026 |
| 4.0.592 | 3,515 | 7/28/2026 |
| 4.0.591 | 414 | 7/28/2026 |
| 4.0.590 | 107 | 7/28/2026 |
| 4.0.589 | 7,046 | 7/16/2026 |
| 4.0.588 | 856 | 7/16/2026 |
| 4.0.587 | 108 | 7/16/2026 |
| 4.0.586 | 6,876 | 7/2/2026 |
| 4.0.585 | 3,690 | 6/19/2026 |
| 4.0.584 | 1,534 | 6/18/2026 |
| 4.0.582 | 10,498 | 6/5/2026 |
Update dependency Soenneker.Gen.EnumValues to 4.0.46 (#1147)