Soenneker.Enums.UnitOfTime
11.0.637
Prefix Reserved
dotnet add package Soenneker.Enums.UnitOfTime --version 11.0.637
NuGet\Install-Package Soenneker.Enums.UnitOfTime -Version 11.0.637
<PackageReference Include="Soenneker.Enums.UnitOfTime" Version="11.0.637" />
<PackageVersion Include="Soenneker.Enums.UnitOfTime" Version="11.0.637" />
<PackageReference Include="Soenneker.Enums.UnitOfTime" />
paket add Soenneker.Enums.UnitOfTime --version 11.0.637
#r "nuget: Soenneker.Enums.UnitOfTime, 11.0.637"
#:package Soenneker.Enums.UnitOfTime@11.0.637
#addin nuget:?package=Soenneker.Enums.UnitOfTime&version=11.0.637
#tool nuget:?package=Soenneker.Enums.UnitOfTime&version=11.0.637
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 | net11.0 is compatible. |
-
net11.0
- Soenneker.Attributes.PublicOpenApiObject (>= 11.0.66)
- Soenneker.Gen.EnumValues (>= 11.0.65)
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 |
|---|---|---|
| 11.0.637 | 2,085 | 10/26/2026 |
| 11.0.636 | 309 | 10/26/2026 |
| 11.0.635 | 106 | 10/26/2026 |
| 11.0.634 | 272 | 10/26/2026 |
| 4.0.633 | 2,019 | 10/15/2026 |
| 4.0.632 | 314 | 10/14/2026 |
| 4.0.631 | 730 | 10/14/2026 |
| 4.0.629 | 106 | 10/14/2026 |
| 4.0.628 | 97 | 10/14/2026 |
| 4.0.626 | 114 | 10/14/2026 |
| 4.0.625 | 504 | 10/13/2026 |
| 4.0.621 | 112 | 10/13/2026 |
| 4.0.620 | 129 | 10/12/2026 |
| 4.0.618 | 768 | 10/12/2026 |
| 4.0.617 | 1,435 | 10/11/2026 |
| 4.0.615 | 633 | 10/11/2026 |
| 4.0.614 | 2,278 | 9/30/2026 |
| 4.0.613 | 1,524 | 9/25/2026 |
| 4.0.612 | 118 | 9/24/2026 |
| 4.0.611 | 112 | 9/24/2026 |
Updated Soenneker.Attributes.PublicOpenApiObject to 11.0.66