Skip to content

Modern Chrono LocalTime IsValid

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

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

LocalTime.IsValid

Returns true if the time of day is in range.

Syntax

LocalTime.IsValid

Examples

#import "std/chrono"
using chrono

print LocalTime( 14, 30, 5, 0 ).IsValid      '' true
print LocalTime( 25, 0, 0, 0 ).IsValid       '' false -- no such hour
print LocalTime( 0, 60, 0, 0 ).IsValid       '' false -- no such minute

'' The ONLY correct test. An Invalid value is absorbing: anything that
'' touches it becomes Invalid, and it never compares equal to anything.

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

Clone this wiki locally