Declarative Objectivity (DO) Language : Operator Expressions : Date-Time Operators
Date-Time Operators
Date-time operators provide information about dates, times, and datetimes.
Operator
Description
Usage
Unary Operand (op1)
 
Result Type
DAY_NAME
Returns the full name of the day, all uppercase, in English
DAY_NAME(op1)
DateTime, Date
String
DAY_OF_WEEK
Returns the number of the day within the week. (0-6; Sunday is 0)
DAY_OF_WEEK(op1)
DateTime, Date
Integer
DAY_OF_MONTH
Returns the number of the day within the month. (1-31)
DAY_OF_MONTH(op1)
DateTime, Date
Integer
MONTH
Returns the number of the month within the year. (1-12)
MONTH(op1)
DateTime, Date
Integer
MONTH_NAME
Returns the full name of the month, all uppercase, in English
MONTH_NAME(op1)
DateTime, Date
String
WEEK
Returns the number of the week within the year based on the ISO 8601 standard. (1-53)
WEEK(op1)
DateTime, Date
Integer
YEAR
Returns the year
YEAR(op1)
DateTime, Date
Integer
Quick Look 
Return the rental contracts associated with reservations for pickups on Wednesdays:
FROM Reservation WHERE DAY_NAME(pickup) == 'WEDNESDAY' RETURN rental.trackingNumber;
Return the rental contracts associated with reservations created in the year 2017:
FROM Reservation WHERE YEAR(timestamp) == 2017 RETURN rental.trackingNumber;
Discussion 
For general information about operator formats, operands, and precedence, see About Operator Expressions.
See also:
Arithmetic Operators for PLUS and MINUS operators that accept date, time, or datetime operands.
Relational Operators for comparison and equality operators that accept date, time, or datetime operands.