Soenneker.Extensions.DateTime.Quarter 11.0.1385

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

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

Installation

dotnet add package Soenneker.Extensions.DateTime.Quarter

Calendar-field boundaries

using Soenneker.Extensions.DateTime.Quarter;

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

System.DateTime start = value.ToStartOfQuarter();       // 2026-07-01 00:00:00
System.DateTime end = value.ToEndOfQuarter();           // last tick of 2026-09-30
System.DateTime nextStart = value.ToStartOfNextQuarter();
System.DateTime previousEnd = value.ToEndOfPreviousQuarter();

Calendar quarters are January–March, April–June, July–September, and October–December.

Method pair Selected quarter
ToStartOfQuarter() / ToEndOfQuarter() Current
ToStartOfPreviousQuarter() / ToEndOfPreviousQuarter() Previous
ToStartOfNextQuarter() / ToEndOfNextQuarter() Next

Start methods return midnight on the quarter's first date. End methods return one tick before the following quarter. These methods operate on the input calendar fields, preserve Kind, and handle year rollover through DateTime calendar arithmetic.

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 localQuarterStartUtc = utc.ToStartOfTzQuarter(eastern);
System.DateTime localQuarterEndUtc = utc.ToEndOfTzQuarter(eastern);

Time-zone variants are available for the current, previous, and next quarter by adding Tz to the method name, such as ToStartOfPreviousTzQuarter() and ToEndOfNextTzQuarter(). They select the quarter using the input instant's local calendar and return the boundary as a UTC DateTime.

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.

Quarter ends are one tick before the following valid local quarter boundary. If a local quarter 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 (1)

Showing the top 1 NuGet packages that depend on Soenneker.Extensions.DateTime.Quarter:

Package Downloads
Soenneker.Extensions.DateTime.Suite

A collection of all the DateTime precision extension methods

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.1385 144 11/3/2026
11.0.1384 88 11/3/2026
11.0.1383 91 11/3/2026
11.0.1382 157 10/27/2026
11.0.1381 138 10/26/2026
11.0.1379 100 10/26/2026
11.0.1378 104 10/26/2026
11.0.1377 96 10/26/2026
11.0.1376 97 10/26/2026
11.0.1375 90 10/26/2026
4.0.1374 348 10/15/2026
4.0.1373 99 10/15/2026
4.0.1372 130 10/14/2026
4.0.1371 107 10/14/2026
4.0.1370 117 10/14/2026
4.0.1369 99 10/14/2026
4.0.1368 114 10/14/2026
4.0.1362 116 10/13/2026
4.0.1361 106 10/12/2026
4.0.1359 139 10/12/2026
Loading failed

Update dependency Soenneker.Extensions.DateTime to 11.0.1847 (#1799)