Date operators
Explains the use of date operators in IBM ILOG Script.
There are no specific operators for dealing with dates, but, since numeric operators automatically convert their arguments to numbers, these operators can be used to compute the time elapsed between two dates, to compare dates, or to add a given amount of time to a date. For example:
date1 - date2 -> the number of milliseconds elapsed between date1 and date2.
date1 < date2 -> true if date1 is before date2, false otherwise.
new Date(date+10000) ->
a date representing 10000 milliseconds after date.
The following program displays the number of milliseconds
taken to execute the statement <do something> :
before = new Date();
<do something>;
after = new Date();
writeln("Time for doing something: ", after-before, " milliseconds.");