Newer Version Available
Access Date Functions with Time Zone Enabled
Use these functions to get the day, week, year, and other parts of DateTime or DateOnly fields.
The return values are numbers.
- year (DateTime | DateOnly)
- quarter (DateTime | DateOnly)
- month (DateTime | DateOnly)
- week (DateTime | DateOnly)
- day (DateTime | DateOnly)
- minute (DateTime | DateOnly)
- second (DateTime | DateOnly)
- fiscalYear (DateTime | DateOnly)
- fiscalQuarter (DateTime | DateOnly)
- fiscalMonth (DateTime | DateOnly)
- fiscalWeek (DateTime | DateOnly)
- epochDay (DateTime | DateOnly)
- epochSecond( DateTime | DateOnly)
Examples
Use year(), month(), and day() to project the year,
month, and day for each record. CloseDate can be a
DateTime or DateOnly
type.
Use month() to find results that closed in December.
Use month() to order opportunities by month of close date.