Syntax: Date()

The Date function will return the date and time in a new object, or it can be used to set the date and time in a new object. You can retrieve individual properties of the date or time, such as, day, month, year, hours, minutes, seconds or milliseconds. In order to manipulate the Date function you must create a new instance of the date within OpusScript using the new operator.

Date Functions

Syntax:

var dateName = new Date(parameters)

Remarks:

var - is used to create a new variable in which the date will be stored.

dateName – the name you want to give to the variable.

new – the operator that states you are creating a new instance of the object specified.

Date – the object you want to create a new instance of.

Parameters – this is optional. If no parameter is entered the new Date is set to the current date and time on your PC. You can enter the parameter as a number of milliseconds since Midnight 1/1/1970 or you can enter the parameter as a string, showing the date and time or just the date you want to set (see examples below).

image\Script_Button.jpgExamples