Date Operators

OperatorDescriptionExample
$dayOfWeekReturns the day of the week for the passed in date property or expression as a number from 1 (Sunday) to 7 (Saturday).{"$dayOfWeek": "created"}
$dayOfMonthReturns the day of the month for the passed in date property or expression as a number from 1 to 31{"$dayOfMonth": "created"}
$dayOfYearReturns the day of the year for the passed in date property or expression as a number from 1 to 366{"$dayOfYear": "created"}
$yearReturns the year for the passed in date property or expression.{"$year": "created"}
$monthReturns the month for the passed in date property or expression.{"$month": "created"}
$weekReturns the week of the year for the passed in date property or expression as a number between 0 (the partial week that precedes the first Sunday of the year) and 53 (in a leap year).{"$week": "created"}
$hourReturns the hour for the passed in date property or expression as a number between 0 and 23.{"$hour": "created"}
$minuteReturns the minute for the passed in date property or expression as a number between 0 and 59.{"$minute": "created"}
$secondReturns the second for the passed in date property or expression as a number between 0 and 60 (for a leap second).{"$second": "created"}
$millisecondReturns the millisecond for the passed in date property or expression as a number between 0 and 999.{"$millisecond": "created"}
$dateToStringConverts a date object to a string in a specified format, and expects an array of [<format>, date_expression][<format>, date_expression]{ "$dateToString": ["%Y-%m-%d", "created"] }

Date Format Specifiers

SpecifiersDescriptionPossible Values
%dDay of Month (2 digits, zero padded)01-31
%GYear in ISO 8601 format0000-9999
%HHour (2 digits, zero padded, 24-hour clock)00-23
%jDay of year (3 digits, zero padded)001-366
%LMillisecond (3 digits, zero padded)000-999
%mMonth (2 digits, zero padded)01-12
%MMinute (2 digits, zero padded)00-59
%SSecond (2 digits, zero padded)00-60
%uDay of week number in ISO 8601 format (1-Monday, 7-Sunday)1-7
%UWeek of year (2 digits, zero padded)00-53
%VWeek of Year in ISO 8601 format1-53
%wDay of week (1-Sunday, 7-Saturday)1-7
%YYear (4 digits, zero padded)0000-9999
%%Percent Character as a Literal%