Soenneker.Extensions.DateTime.Quarter 4.0.1347

Prefix Reserved
dotnet add package Soenneker.Extensions.DateTime.Quarter --version 4.0.1347
                    
NuGet\Install-Package Soenneker.Extensions.DateTime.Quarter -Version 4.0.1347
                    
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="4.0.1347" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Extensions.DateTime.Quarter" Version="4.0.1347" />
                    
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 4.0.1347
                    
#r "nuget: Soenneker.Extensions.DateTime.Quarter, 4.0.1347"
                    
#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@4.0.1347
                    
#: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=4.0.1347
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.DateTime.Quarter&version=4.0.1347
                    
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 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. 
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
4.0.1347 125 9/16/2026
4.0.1346 110 9/16/2026
4.0.1345 71 9/15/2026
4.0.1344 72 9/15/2026
4.0.1343 143 9/13/2026
4.0.1342 152 9/13/2026
4.0.1341 158 9/12/2026
4.0.1340 90 9/12/2026
4.0.1339 81 9/12/2026
4.0.1338 83 9/12/2026
4.0.1337 243 9/10/2026
4.0.1336 144 9/9/2026
4.0.1335 211 9/8/2026
4.0.1334 174 9/7/2026
4.0.1333 104 9/7/2026
4.0.1332 138 9/7/2026
4.0.1331 141 9/6/2026
4.0.1330 181 9/4/2026
4.0.1329 218 9/1/2026
4.0.1328 186 8/31/2026
Loading failed

Updated NuGet packages