Soenneker.Extensions.DateTimeOffsets.Months 11.0.192

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Extensions.DateTimeOffsets.Months --version 11.0.192
                    
NuGet\Install-Package Soenneker.Extensions.DateTimeOffsets.Months -Version 11.0.192
                    
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.DateTimeOffsets.Months" Version="11.0.192" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Extensions.DateTimeOffsets.Months" Version="11.0.192" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Extensions.DateTimeOffsets.Months" />
                    
Project file
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.DateTimeOffsets.Months --version 11.0.192
                    
#r "nuget: Soenneker.Extensions.DateTimeOffsets.Months, 11.0.192"
                    
#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.DateTimeOffsets.Months@11.0.192
                    
#: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.DateTimeOffsets.Months&version=11.0.192
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.DateTimeOffsets.Months&version=11.0.192
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

alternate text is missing from this package README image 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 Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.195 0 12/2/2026
11.0.194 0 12/2/2026
11.0.193 0 12/2/2026
11.0.192 71 12/2/2026
11.0.191 129 12/1/2026
11.0.190 94 12/1/2026
11.0.189 79 12/1/2026
11.0.188 118 12/1/2026
11.0.187 136 12/1/2026
11.0.186 173 11/30/2026
11.0.185 330 11/19/2026
11.0.184 113 11/19/2026
11.0.183 141 11/18/2026
11.0.181 157 11/18/2026
11.0.180 122 11/18/2026
11.0.179 176 11/15/2026
11.0.178 223 11/15/2026
11.0.176 364 11/11/2026
11.0.175 154 11/11/2026
11.0.174 160 11/11/2026
Loading failed

Updated Soenneker.Extensions.DateTimeOffsets to 11.0.220