Date and Timestamp
The Date data type contains a date value, and the Timestamp data type contains a date and time value. Date and Timestamp methods must evaluate to a Boolean value. You can add these methods to the date or timestamp data types:
Table 23-3 Data and Timestamp Methods
Method | Description |
---|---|
after |
Returns True if the date or timestamp value is after the specified point in time |
afterOrEqual |
Returns True if the date or timestamp value is after or on the specified point in time |
before |
Returns True if the date or timestamp value is before the specified point in time |
beforeOrEqual |
Returns True if the date or timestamp value is before or on the specified point in time |
equals |
Returns True if the date or timestamp value equals the specified point in time |
format (Date data type only)
|
Convert a date into a formatted string data type. For example,
See Date and Time Formatting Symbols for date and time formatting. |
isNull |
Returns True if the date or timestamp has a null value |
minus |
Returns a date with the specified period subtracted. You must specify the amount and the unit (Days, Weeks, Months, Years) of time to subtract. |
plus |
Returns a date with the specified period added. You must specify the amount and the unit (Days, Weeks, Months, Years) of time to add. |
toDate (Timestamp data type only)
|
Converts a timestamp into a date by truncating the time portion. |
Note:
You cannot enter literal values as date or timestamp values in expressions. For
example, you can create a custom validation for node.properties.startDate
before node.properties.endDate
, but not
node.properties.startDate before "01-01-2019"
.