Date operators are used to extract date information from date fields when we want to calculate statistics based on the day of the week/month/year using the pipeline:
- $dayOfYear is used to get the day of the year within a range of 1 to 366 (for a leap year)
- $dayOfMonth is used to get the day of the month within a range of 1 to 31
- $dayOfWeek is used to get the day of the week within a range of 1 to 7, with 1 being Sunday and 7 being Saturday (using English days of the week)
- $isoDayOfWeek returns the weekday number in the ISO 8601 date format within a range of 1 to 7, with 1 being Monday and 7 being Sunday
- $week is the week number within a range of 0 to 53, with 0 being the partial week at the beginning of each year to 53 for a year with a leap week
- $isoWeek returns the week number in the ISO 8601 date format within a range of 1 to 53, 1 being the first week of the year that contains a Thursday and 53 being a leap week, if one exists in the year in question
- $year, $month, $hour, $minute, $milliSecond return the relevant portion of the date in zero-based numbering, except for $month, which returns a value ranging from 1 through 12
- $isoWeekYear returns the year in ISO 8601 date format according to the date that the last week in ISO 8601 date format ends (for example, 2016/1/1 will still return 2015)
- $second returns 0 to 60 inclusive for leap seconds
- $dateToString converts a date input to a string