Home Contents | # date:daysInMonth | Date/Time | Core4 Lua Commands

## SYNOPSIS

1. n = date:daysInMonth()
2. n = date:daysInYear()

## DESCRIPTION

The date:daysInMonth() returns the number of days in the month stored in date.

The date:daysInYear() returns the number of days in the year stored in date.

Both function know about leap years and will adjust accordingly.

## RETURN VALUE

The number of days in the stored month or year, respectively.

## ERRORS

Raises an error if date is not a date instance.

## EXAMPLE

> >
d = clock.newDate(2000, 2, 1) print(d, d:daysInMonth(), d:daysInYear())
2000-02-01 29 366

## SEE ALSO

clock.currentDate, clock.newDate, date(), date:addDays, date:addMonths, date:addYears, date:day, date:dayOfWeek, date:dayOfYear, date:days90, date:daysTo, date:format, date:isNull, date:isValid, date:month, date:set, date:setDays90, date:weekNumber, date:year, tostring(date)