Skip to content

Modern Chrono DateTime DaysInMonth

Paul Squires edited this page Oct 19, 2026 · 1 revision

Home › Date and Time (Chrono) › Chrono Date and Time › DateTime.DaysInMonth

DateTime.DaysInMonth

Returns the number of days in a month of a given year.

Syntax

DateTime.DaysInMonth( y, mo )

Examples

#import "std/chrono"
using chrono

print DateTime.DaysInMonth( 2026, 8 )   '' 31
print DateTime.DaysInMonth( 2026, 2 )   '' 28
print DateTime.DaysInMonth( 2024, 2 )   '' 29 -- leap year

'' Static, taking the year and month rather than a DateTime

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

Clone this wiki locally