Date Object Functions
Related Functions & Properties getMilliseconds() toString() toDateString() toTimeString() dateAdd(interval, amount, date) dateDiff(interval, date1, date2) datePart(interval, date) The JavaScript Date object is very similar to Java Date object. It stores the time and date and can be used to manipulate dates and perform date conversions. There are several ways to create a date object. Invoked without arguments, the new date object contains the time and date of its creation:
var now = new Date() // Thu Jun 12 15:14:51 EDT 2009
You can also create a Date object by specifying elapsed milliseconds from January 1, 1970:
var due_date = new Date(800000000000);
// Tue May 09 02:13:20 EDT 1995
Alternatively, create the Date object from individual date components:
var due_date = new Date(1988,0,10); // Sun Jan 10 00:00:00 EST 1988
There are a number of methods in the Date object for manipulating date fields. Since the scripts in Style Intelligence are primarily used to work with Java objects, it is more common for a script to work with the java.util.Date object. The use of Java objects is covered in Appendix JS.9, Java Objects (LiveConnect).