Soenneker.Extensions.DateTime.Month 11.0.1821

Prefix Reserved
dotnet add package Soenneker.Extensions.DateTime.Month --version 11.0.1821
                    
NuGet\Install-Package Soenneker.Extensions.DateTime.Month -Version 11.0.1821
                    
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.DateTime.Month" Version="11.0.1821" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Extensions.DateTime.Month" Version="11.0.1821" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Extensions.DateTime.Month" />
                    
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.DateTime.Month --version 11.0.1821
                    
#r "nuget: Soenneker.Extensions.DateTime.Month, 11.0.1821"
                    
#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.DateTime.Month@11.0.1821
                    
#: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.DateTime.Month&version=11.0.1821
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.DateTime.Month&version=11.0.1821
                    
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.DateTime.Month

Computes current, previous, and next calendar-month boundaries for DateTime, with optional time-zone-aware UTC results.

Installation

dotnet add package Soenneker.Extensions.DateTime.Month

Calendar-field boundaries

using Soenneker.Extensions.DateTime.Month;

System.DateTime value = new(2026, 8, 29, 16, 42, 30, DateTimeKind.Utc);

System.DateTime start = value.ToStartOfMonth();
System.DateTime end = value.ToEndOfMonth();
System.DateTime previousStart = value.ToStartOfPreviousMonth();
System.DateTime nextEnd = value.ToEndOfNextMonth();
Method Result
ToStartOfMonth() First tick of the current month
ToEndOfMonth() Last tick before the next month
ToStartOfPreviousMonth() First tick of the previous month
ToEndOfPreviousMonth() Last tick before the current month
ToStartOfNextMonth() First tick of the next month
ToEndOfNextMonth() Last tick before the month after next

These methods operate on the existing calendar fields, handle varying month lengths and leap years through DateTime calendar arithmetic, and preserve the input Kind. They do not perform time-zone conversion.

Time-zone-aware boundaries

TimeZoneInfo eastern = TimeZoneInfo.FindSystemTimeZoneById("America/New_York");
System.DateTime utc = new(2026, 8, 29, 18, 0, 0, DateTimeKind.Utc);

System.DateTime localMonthStartUtc = utc.ToStartOfTzMonth(eastern);
System.DateTime localMonthEndUtc = utc.ToEndOfTzMonth(eastern);

The time-zone variants select the current, previous, or next month from the input instant's local calendar and return its boundary as a UTC DateTime:

  • ToStartOfTzMonth() / ToEndOfTzMonth()
  • ToStartOfPreviousTzMonth() / ToEndOfPreviousTzMonth()
  • ToStartOfNextTzMonth() / ToEndOfNextTzMonth()

If the input Kind is not Utc, its fields are treated as UTC rather than converted from the machine's local zone. Supply an actual UTC value to avoid ambiguity.

Month ends are defined as one tick before the following valid local month boundary. If a local month begins in a daylight-saving gap, the boundary advances to the first valid local minute; if it is ambiguous, the earlier UTC instant is selected.

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 (2)

Showing the top 2 NuGet packages that depend on Soenneker.Extensions.DateTime.Month:

Package Downloads
Soenneker.Extensions.DateTime.Suite

A collection of all the DateTime precision extension methods

Soenneker.Utils.DateTime

A utility library for helpful DateTime related operations

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.1821 194 11/19/2026
11.0.1820 114 11/19/2026
11.0.1819 123 11/18/2026
11.0.1818 142 11/18/2026
11.0.1816 262 11/15/2026
11.0.1815 199 11/14/2026
11.0.1814 390 11/11/2026
11.0.1813 119 11/11/2026
11.0.1812 138 11/11/2026
11.0.1811 131 11/11/2026
11.0.1810 134 11/11/2026
11.0.1809 150 11/11/2026
11.0.1808 102 11/11/2026
11.0.1807 126 11/11/2026
11.0.1806 175 11/11/2026
11.0.1805 125 11/10/2026
11.0.1804 102 11/10/2026
11.0.1803 803 11/3/2026
11.0.1801 191 11/3/2026
11.0.1800 619 10/27/2026
Loading failed

Updated Multiple NuGet packages