Skip to content

Modern Chrono LocalDate AddYears

Paul Squires edited this page Oct 19, 2026 · 5 revisions

Home › Date and Time (Chrono) › Chrono Date and Time › LocalDate.AddYears

LocalDate.AddYears

Returns the date moved by whole years; 29 February becomes the 28th if needed.

Syntax

LocalDate.AddYears( n )

Examples

#import "std/chrono"
using chrono

dim as LocalDate d = LocalDate( 2026, 8, 13 )
print d.AddYears( 4 ).ToIsoString( )     '' 2030-08-13

'' 29 February clamps to the 28th in a non-leap year, the same rule
'' AddMonths follows
print LocalDate( 2024, 2, 29 ).AddYears( 1 ).ToIsoString( )     '' 2025-02-28

Library: Chrono Date and Time
Category: Date and Time (Chrono)
Documented under: The Members

Clone this wiki locally