Soenneker.Extensions.DateTime.Year 11.0.1389

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

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

Installation

dotnet add package Soenneker.Extensions.DateTime.Year

Calendar-field boundaries

using Soenneker.Extensions.DateTime.Year;

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

System.DateTime start = value.ToStartOfYear();
System.DateTime end = value.ToEndOfYear();
System.DateTime previousStart = value.ToStartOfPreviousYear();
System.DateTime nextEnd = value.ToEndOfNextYear();
Method pair Selected year
ToStartOfYear() / ToEndOfYear() Current
ToStartOfPreviousYear() / ToEndOfPreviousYear() Previous
ToStartOfNextYear() / ToEndOfNextYear() Next

Starts are January 1 at midnight. Ends are one tick before January 1 of the following year. These methods operate on the input calendar fields, preserve Kind, and use DateTime calendar arithmetic, including leap years. 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 localYearStartUtc = utc.ToStartOfTzYear(eastern);
System.DateTime localYearEndUtc = utc.ToEndOfTzYear(eastern);

Time-zone variants cover the current, previous, and next local calendar year and return boundaries as UTC DateTime values. Their names follow the same pattern, including ToStartOfPreviousTzYear() and ToEndOfNextTzYear().

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.

Year ends are one tick before the following valid local January 1 boundary. If a local year 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.Year:

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.1389 0 11/14/2026
11.0.1388 287 11/11/2026
11.0.1387 83 11/11/2026
11.0.1386 106 11/11/2026
11.0.1384 95 11/11/2026
11.0.1383 116 11/11/2026
11.0.1382 79 11/11/2026
11.0.1381 89 11/11/2026
11.0.1380 99 11/11/2026
11.0.1379 97 11/11/2026
11.0.1378 97 11/10/2026
11.0.1377 95 11/10/2026
11.0.1376 667 11/3/2026
11.0.1375 132 11/3/2026
11.0.1374 118 11/3/2026
11.0.1373 259 10/27/2026
11.0.1372 142 10/26/2026
11.0.1371 92 10/26/2026
11.0.1370 105 10/26/2026
11.0.1369 96 10/26/2026
Loading failed

Update dependency Soenneker.Extensions.DateTime to 11.0.1859 (#1783)