InLeapYear - Built-in Date & Time Function¶
Purpose¶
Returns whether the specified date expression resolves to a leap year or not.
Syntax¶
InLeapYear(datetime)
Arguments¶
| Argument | Required | Description |
|---|---|---|
datetime |
Yes | Any valid datetime expression. |
Returns¶
Boolean
See also¶
- Date
- DateAdd
- DateDiff
- DatePart
- DateValue
- DateSerial
- Day
- Hour
- InAgedToDays
- InLast4WeeksToSunday
- InLast7Days
- InLastFullMonth
- InLastFullWeek
- InLastYearMTD
- InLastYearYTD
- Minute
- Month
- MonthName
- Now
- Second
- Time
- TimeSerial
- TimeValue
- WeekAgo
- Weekday
- WeekdayName
- Year
Examples¶
Show whether we are currently in a leap year¶
If InLeapYear(Now()) then
Return "We are in a leap year"
Else
Return "We are not in a leap year"
End
As filter function¶
return InLeapYear({OrderHeader.Order_Date})
Notes¶
- When the arguments cannot be converted to a datetime value, a runtime error is generated.
- A leap year is a year where the mod operation with 4 and 400 returns a 0. Century years like 1900 deliver a zero with 4 but 100, 200, or 300 when the modulo is 400.