Soenneker.Extensions.TimeSpan
4.0.1785
Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Soenneker.Extensions.TimeSpan --version 4.0.1785
NuGet\Install-Package Soenneker.Extensions.TimeSpan -Version 4.0.1785
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Extensions.TimeSpan" Version="4.0.1785" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Extensions.TimeSpan" Version="4.0.1785" />
<PackageReference Include="Soenneker.Extensions.TimeSpan" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Extensions.TimeSpan --version 4.0.1785
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Soenneker.Extensions.TimeSpan, 4.0.1785"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.Extensions.TimeSpan@4.0.1785
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Extensions.TimeSpan&version=4.0.1785
#tool nuget:?package=Soenneker.Extensions.TimeSpan&version=4.0.1785
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Soenneker.Extensions.TimeSpan
A collection of helpful TimeSpan extension methods.
Installation
dotnet add package Soenneker.Extensions.TimeSpan
Quick start
using Soenneker.Extensions.TimeSpan;
TimeSpan timeSpan = TimeSpan.FromMinutes(5);
var result = timeSpan.ToShortTime();
Common operations
ToShortTime()- Converts aSystem.TimeSpanto a short time string representation. Returns a string representing the time in short time format (e.g., "10:00 PM").ToUtcFromTz()- Adjusts aSystem.TimeSpanfrom a specific time zone to UTC by subtracting the time zone's offset from UTC. DateTimeOffset overload.ToTzFromUtc()- Converts a UTCSystem.TimeSpanto a specific time zone by adding the time zone's offset from UTC. DateTimeOffset overload.IsBetween()- Determines whether the specifiedSystem.TimeSpanfalls within a given range, inclusive of the start and exclusive of the end.ToDisplayFormat()- Formats the duration in its most useful unit;compactselects abbreviated versus long unit names.ToHourMinuteSecondString()- Converts a time span into a string formatted as hours, minutes, and seconds. Returns a string representation of the time span in the format 'hh:mm:ss'.ToMinuteSecondString()- Converts a time span into a string formatted as hours, minutes, and seconds. Returns a string representation of the time span in the format 'hh:mm:ss'.
| 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Soenneker.Extensions.DateTime (>= 4.0.1781)
- Soenneker.Extensions.DateTimeOffsets (>= 4.0.135)
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 |
|---|---|---|
| 4.0.1820 | 33 | 9/13/2026 |
| 4.0.1819 | 40 | 9/13/2026 |
| 4.0.1818 | 42 | 9/12/2026 |
| 4.0.1817 | 39 | 9/12/2026 |
| 4.0.1816 | 37 | 9/12/2026 |
| 4.0.1815 | 40 | 9/12/2026 |
| 4.0.1814 | 41 | 9/12/2026 |
| 4.0.1813 | 39 | 9/12/2026 |
| 4.0.1812 | 54 | 9/10/2026 |
| 4.0.1811 | 56 | 9/10/2026 |
| 4.0.1810 | 64 | 9/9/2026 |
| 4.0.1809 | 70 | 9/9/2026 |
| 4.0.1808 | 76 | 9/8/2026 |
| 4.0.1807 | 86 | 9/8/2026 |
| 4.0.1806 | 86 | 9/8/2026 |
| 4.0.1805 | 96 | 9/7/2026 |
| 4.0.1804 | 96 | 9/7/2026 |
| 4.0.1803 | 95 | 9/7/2026 |
| 4.0.1802 | 90 | 9/7/2026 |
| 4.0.1785 | 95 | 8/30/2026 |
Loading failed
Update dependency Soenneker.Extensions.DateTimeOffsets to 4.0.135 (#2180)