Soenneker.Extensions.DateTime.Quarter 4.0.1325

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Extensions.DateTime.Quarter --version 4.0.1325
                    
NuGet\Install-Package Soenneker.Extensions.DateTime.Quarter -Version 4.0.1325
                    
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.1325" />
                    
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.1325" />
                    
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.1325
                    
#r "nuget: Soenneker.Extensions.DateTime.Quarter, 4.0.1325"
                    
#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.1325
                    
#: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.1325
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.DateTime.Quarter&version=4.0.1325
                    
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.1329 32 9/1/2026
4.0.1328 89 8/31/2026
4.0.1327 58 8/31/2026
4.0.1326 81 8/31/2026
4.0.1325 74 8/31/2026
4.0.1324 85 8/30/2026
4.0.1323 91 8/30/2026
4.0.1322 47 8/30/2026
4.0.1321 45 8/30/2026
4.0.1320 42 8/29/2026
4.0.1319 134 8/29/2026
4.0.1318 51 8/29/2026
4.0.1317 48 8/29/2026
4.0.1316 179 8/25/2026
4.0.1315 309 8/21/2026
4.0.1314 146 8/18/2026
4.0.1313 116 8/18/2026
4.0.1312 227 8/7/2026
4.0.1311 193 7/28/2026
4.0.1310 104 7/28/2026
Loading failed

Update dependency Soenneker.Extensions.DateTime to 4.0.1783 (#1701)