Note: A DateTime data type must contain both date information and time information. Applying a DateTime operator to a DateTime attribute should always produce a result. Be sure to use the data type that suits your needs.

Corticon's DateTime attribute operators are as follows:

Name and Syntax Returns Description
Equals (used as a comparison)
<DateTime1> = <DateTime2> Boolean Returns a value of true if <DateTime1> is the same as <DateTime2>, including both the Date and the Time portions
Equals (used as an assignment)
<DateTime1> = <DateTime2> DateTime Assigns the value of <DateTime2> to <DateTime1>
Not Equal To
<DateTime1> <> <DateTime2> Boolean Returns a value of true if <DateTime1> does not equal <DateTime2>
Less than
<DateTime1> < <DateTime2> Boolean Returns a value of true if <Date1> is less than <Date2>
Greater than
<DateTime1> > <DateTime2> Boolean Returns a value of true if <DateTime1> is greater than or equal to <DateTime2>
Less than or Equal to
<DateTime1> <= <DateTime2> Boolean Returns a value of true if <DateTime1> is less than or equal to <DateTime2>
Greater than or Equal to
<DateTime1> >= <DateTime2> Boolean Returns a value of true if <DateTime1> is greater than or equal to <DateTime2>
In (Range)
attributeReference in [ |(rangeExpression)|] Boolean Returns a value of true if attributeReference is in the range of DateTime values from..to, and where opening and closing parentheses ( )indicate exclusion of that limit and square brackets [ ] indicate inclusion of that limit.
In (List)
attributeReference in {listExpression} Boolean Returns a value of true if attributeReference is in the comma-delimited list of literal values, defined enumeration values, or - if in use - enumeration labels.
Year
<DateTime>.year Integer Returns the century/year portion of <DateTime> as a four digit Integer
Month
<DateTime>.month Integer Returns the month in <DateTime> as an Integer between 1 and 12
Day
<DateTime>.day Integer Returns the day portion of <DateTime> as an Integer between 1 and 31
Hour
<DateTime>.hour Integer Returns the hour portion of <DateTime>. The returned value is based on a 24-hour clock.
Minute
<DateTime>.min Integer Returns the minute portion of <DateTime> as an Integer between 0 and 59
Second
<DateTime>.sec Integer Returns the seconds portion of <DateTime> as an Integer between 0 and 59
Add years
<DateTime>.addYears (<Integer>) Date Adds the number of years in <Integer> to the number of years in <DateTime>
Add months
<DateTime>.addMonths (<Integer>) Date Adds the number of months in <Integer> to the number of months in <DateTime>
Add days
<DateTime>.addDays (<Integer>) Date Adds the number of days in <Integer> to the number of days in <DateTime>
Add hours
<DateTime>.addHours (<Integer>) Date Adds the number of hours in <Integer> to the number of hours in the Time portion of <DateTime>
Add minutes
<DateTime>.addMinutes (<Integer>) Date Adds the number of minutes in <Integer> to the number of minutes in the Time portion of <DateTime>
Add seconds
<DateTime>.addSeconds (<Integer>) Date Adds the number of seconds in <Integer> to the number of seconds in the Time portion of <DateTime>
Years between
<DateTime1>.yearsBetween (<DateTime2>) Integer Returns the Integer number of years between <DateTime1> and <Date2>. This function returns a positive number if <DateTime2> is later than <DateTime1>.
Months between
<DateTime1>.monthsBetween (<DateTime2>) Integer Returns the Integer number of months between <DateTime1> and <DateTime2>. If the month and year portions of <DateTime1> and <DateTime2> are the same, the result is zero. This function returns a positive number if <DateTime2> is later than <DateTime1>.
Days between
<DateTime1>.daysBetween (<DateTime2>) Integer Returns the Integer number of days between <DateTime1> and <DateTime2>. If the two dates differ by less than a full 24-hour period, the value is zero. This function returns a positive number if <DateTime2> is later than <DateTime1>.
Hours between
<DateTime1>.hoursBetween (<DateTime2>) Integer Returns the Integer number of hours between <DateTime1> and <DateTime2>. If the two dates differ by less than a full hour, the value is zero. This function returns a positive number if <DateTime2> is later than <DateTime1>.
Minutes between
<DateTime1>.minsBetween (<DateTime2>) Integer Returns the Integer number of minutes between <DateTime1> and <DateTime2>. This function returns a positive number if <DateTime2> is later than <DateTime1>.
Seconds between
<DateTime1>.secsBetween (<DateTime2>) Integer Returns the Integer number of seconds between <DateTime1> and <DateTime2>. This function returns a positive number if <DateTime2> is later than <DateTime1>.
Day of Week
<DateTime>.dayOfWeek Integer Returns an Integer corresponding to day of the week, with Sunday equal to 1, in <DateTime>.
Week of Year
<DateTime>.weekOfYear Integer Returns an Integer from 1 to 52, equal to the week number within the year in <DateTime>
Day of Year
<DateTime>.dayOfYear Integer Returns an Integer from 1 to 366, equal to the day number within the year in <DateTime>
Week of Month
<DateTime>.weekOfMonth Integer Returns an Integer from 1 to 6, equal to the week number within the month in <DateTime> or <Date>. A week begins on Sunday and ends on Saturday.
To Date
<DateTime>.toDate Date Returns the date portion only of DateTime
To Time
<DateTime>.toTime Time Returns the time portion only of DateTime
To String
<DateTime>.toString String Converts DateTime to a String with date and time information
getMilliseconds
<DateTime>.getMilliseconds Integer Returns the internal date/time, namely the number of milliseconds that have transpired since the epoch 1/1/1970 00:00:00 GMT.
toZulu
<DateTime>.toZulu String Returns an ISO-8601-compliant date-time as a String.