Soenneker.Extensions.DateTimeOffsets.Months
11.0.170
Prefix Reserved
dotnet add package Soenneker.Extensions.DateTimeOffsets.Months --version 11.0.170
NuGet\Install-Package Soenneker.Extensions.DateTimeOffsets.Months -Version 11.0.170
<PackageReference Include="Soenneker.Extensions.DateTimeOffsets.Months" Version="11.0.170" />
<PackageVersion Include="Soenneker.Extensions.DateTimeOffsets.Months" Version="11.0.170" />
<PackageReference Include="Soenneker.Extensions.DateTimeOffsets.Months" />
paket add Soenneker.Extensions.DateTimeOffsets.Months --version 11.0.170
#r "nuget: Soenneker.Extensions.DateTimeOffsets.Months, 11.0.170"
#:package Soenneker.Extensions.DateTimeOffsets.Months@11.0.170
#addin nuget:?package=Soenneker.Extensions.DateTimeOffsets.Months&version=11.0.170
#tool nuget:?package=Soenneker.Extensions.DateTimeOffsets.Months&version=11.0.170
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 | net11.0 is compatible. |
-
net11.0
- Soenneker.Extensions.DateTimeOffsets (>= 11.0.197)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Soenneker.Extensions.DateTimeOffsets.Months:
| Package | Downloads |
|---|---|
|
Soenneker.Extensions.DateRangeType
A collection of helpful DateRangeType enum extension methods |
|
|
Soenneker.Extensions.DateTimeOffsets.Suite
A collection of all of the helpful DateTimeOffset extension methods |
|
|
Soenneker.Utils.DateTimeOffsets
Helpful utility methods surrounding DateTimeOffsets |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.170 | 252 | 11/3/2026 |
| 11.0.169 | 118 | 11/3/2026 |
| 11.0.168 | 162 | 11/3/2026 |
| 11.0.167 | 220 | 10/27/2026 |
| 11.0.166 | 172 | 10/26/2026 |
| 11.0.165 | 119 | 10/26/2026 |
| 11.0.164 | 129 | 10/26/2026 |
| 11.0.163 | 178 | 10/26/2026 |
| 4.0.162 | 746 | 10/15/2026 |
| 4.0.161 | 100 | 10/15/2026 |
| 4.0.160 | 150 | 10/14/2026 |
| 4.0.158 | 162 | 10/14/2026 |
| 4.0.157 | 136 | 10/14/2026 |
| 4.0.156 | 144 | 10/14/2026 |
| 4.0.150 | 177 | 10/12/2026 |
| 4.0.148 | 199 | 10/12/2026 |
| 4.0.147 | 149 | 10/12/2026 |
| 4.0.146 | 136 | 10/12/2026 |
| 4.0.145 | 112 | 10/11/2026 |
| 4.0.144 | 284 | 10/11/2026 |
Updated Soenneker.Extensions.DateTimeOffsets to 11.0.197