Soenneker.Extensions.DateTimeOffsets.Months
4.0.137
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Extensions.DateTimeOffsets.Months --version 4.0.137
NuGet\Install-Package Soenneker.Extensions.DateTimeOffsets.Months -Version 4.0.137
<PackageReference Include="Soenneker.Extensions.DateTimeOffsets.Months" Version="4.0.137" />
<PackageVersion Include="Soenneker.Extensions.DateTimeOffsets.Months" Version="4.0.137" />
<PackageReference Include="Soenneker.Extensions.DateTimeOffsets.Months" />
paket add Soenneker.Extensions.DateTimeOffsets.Months --version 4.0.137
#r "nuget: Soenneker.Extensions.DateTimeOffsets.Months, 4.0.137"
#:package Soenneker.Extensions.DateTimeOffsets.Months@4.0.137
#addin nuget:?package=Soenneker.Extensions.DateTimeOffsets.Months&version=4.0.137
#tool nuget:?package=Soenneker.Extensions.DateTimeOffsets.Months&version=4.0.137
Soenneker.Extensions.DateTimeOffsets.Months
Month-boundary extensions for DateTimeOffset, including time-zone-aware boundaries returned as UTC instants.
Installation
dotnet add package Soenneker.Extensions.DateTimeOffsets.Months
Offset-preserving boundaries
Use these methods when the value's existing calendar month and offset are already the frame of reference. They do not apply time-zone rules.
using Soenneker.Extensions.DateTimeOffsets.Months;
var value = new DateTimeOffset(2024, 3, 15, 14, 30, 0, TimeSpan.FromHours(-5));
DateTimeOffset start = value.ToStartOfMonth();
// 2024-03-01 00:00:00 -05:00
DateTimeOffset end = value.ToEndOfMonth();
// 2024-03-31 23:59:59.9999999 -05:00
Available operations are ToStartOfMonth(), ToEndOfMonth(), ToStartOfPreviousMonth(), ToEndOfPreviousMonth(), ToStartOfNextMonth(), and ToEndOfNextMonth().
Time-zone month boundaries
Use the Tz methods when the input represents an instant and the month must be determined in a particular time zone. The result always has a zero offset.
TimeZoneInfo eastern = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time");
var instant = new DateTimeOffset(2024, 3, 15, 19, 30, 0, TimeSpan.Zero);
DateTimeOffset startUtc = instant.ToStartOfTzMonth(eastern);
// 2024-03-01 05:00:00 +00:00
DateTimeOffset endUtc = instant.ToEndOfTzMonth(eastern);
// One tick before 2024-04-01 04:00:00 +00:00
The time-zone methods are ToStartOfTzMonth(), ToEndOfTzMonth(), ToStartOfPreviousTzMonth(), ToEndOfPreviousTzMonth(), ToStartOfNextTzMonth(), and ToEndOfNextTzMonth().
End methods are inclusive: they return one tick before the following month begins. Boundaries follow the supplied time zone's transition rules; if a historical transition skipped local midnight, the start resolves to the first valid local time in that month.
| 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.Extensions.DateTimeOffsets (>= 4.0.162)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Soenneker.Extensions.DateTimeOffsets.Months:
| Package | Downloads |
|---|---|
|
Soenneker.Extensions.DateTimeOffsets.Suite
A collection of all of the helpful DateTimeOffset extension methods |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.138 | 0 | 9/16/2026 |
| 4.0.137 | 0 | 9/16/2026 |
| 4.0.136 | 5 | 9/15/2026 |
| 4.0.135 | 110 | 9/13/2026 |
| 4.0.134 | 79 | 9/13/2026 |
| 4.0.133 | 109 | 9/12/2026 |
| 4.0.132 | 99 | 9/12/2026 |
| 4.0.131 | 156 | 9/12/2026 |
| 4.0.130 | 204 | 9/10/2026 |
| 4.0.129 | 160 | 9/9/2026 |
| 4.0.128 | 188 | 9/8/2026 |
| 4.0.127 | 200 | 9/8/2026 |
| 4.0.126 | 136 | 9/7/2026 |
| 4.0.125 | 132 | 9/7/2026 |
| 4.0.124 | 180 | 9/7/2026 |
| 4.0.123 | 102 | 9/7/2026 |
| 4.0.122 | 252 | 9/5/2026 |
| 4.0.121 | 264 | 9/4/2026 |
| 4.0.120 | 230 | 9/1/2026 |
| 4.0.119 | 134 | 8/31/2026 |
Updated NuGet packages