Soenneker.Extensions.DateTime.Quarter 4.0.1333

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.1333
                    
NuGet\Install-Package Soenneker.Extensions.DateTime.Quarter -Version 4.0.1333
                    
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.1333" />
                    
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.1333" />
                    
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.1333
                    
#r "nuget: Soenneker.Extensions.DateTime.Quarter, 4.0.1333"
                    
#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.1333
                    
#: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.1333
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.DateTime.Quarter&version=4.0.1333
                    
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.1337 45 9/10/2026
4.0.1336 76 9/9/2026
4.0.1335 131 9/8/2026
4.0.1334 132 9/7/2026
4.0.1333 71 9/7/2026
4.0.1332 100 9/7/2026
4.0.1331 103 9/6/2026
4.0.1330 146 9/4/2026
4.0.1329 211 9/1/2026
4.0.1328 181 8/31/2026
4.0.1327 115 8/31/2026
4.0.1326 161 8/31/2026
4.0.1325 136 8/31/2026
4.0.1324 148 8/30/2026
4.0.1323 153 8/30/2026
4.0.1322 93 8/30/2026
4.0.1321 90 8/30/2026
4.0.1320 87 8/29/2026
4.0.1319 207 8/29/2026
4.0.1318 96 8/29/2026
Loading failed

Updated Multiple NuGet packages