Skip to main content
Date-part functions return a numeric part of a date.

year

Returns the four-digit year.

month

Returns the month as a number from 1 to 12.

day

Returns the day of the month from 1 to 31.

quarter

Returns the calendar quarter from 1 to 4.

half

Returns 1 for January through June and 2 for July through December.

weekday

Returns the day of the week as a number.
Without a return type, Sunday is 1 and Saturday is 7. Optional Excel-compatible return types control the starting day and numbering.

weeknum

Returns the week number within the year.
The optional return type follows Excel. Return type 21 uses ISO weeks.

isoweeknum

Returns the ISO 8601 week number.
This is equivalent to weeknum(Date.Week, 21).