Skip to content

Modern Chrono LocalDate IsValid

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

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

LocalDate.IsValid

Returns true if the date exists and is in range.

Syntax

LocalDate.IsValid

Examples

#import "std/chrono"
using chrono

print LocalDate( 2026, 8, 13 ).IsValid      '' true
print LocalDate( 2025, 2, 30 ).IsValid      '' false -- no such date
print LocalDate( 2024, 2, 29 ).IsValid      '' true -- 2024 is a leap year

'' The only correct test: an Invalid value never compares equal to
'' anything, itself included

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

Clone this wiki locally