Bookshelf Home | Contents | Index | PDF |
Siebel eScript Language Reference > Siebel eScript Commands > The Date Object > The Date Constructor in Siebel eScriptThe Date constructor instantiates a new Date object. To create a Date object that is set to the current date and time, use the new operator, as you would with any object. Syntax AThere are several ways to create a Date object that is set to a date and time. The following lines each demonstrate ways to get and set dates and times. Syntax Bvar dateVar = new Date(milliseconds); Syntax Cvar dateVar = new Date(dateString); Syntax Dvar dateVar = new Date(year, month, day); Syntax Evar dateVar = new Date(year, month, day, hours, minutes, seconds); ReturnsIf a parameter is specified, a Date object representing the date specified by the parameter. UsageSyntax B returns a date and time represented by the number of milliseconds since midnight, January 1, 1970. This representation by milliseconds is a standard way of representing dates and times that makes it simple to calculate the amount of time between one date and another. However, the recommended technique is to convert dates to milliseconds format before doing calculations. Syntax C accepts a string representing a date and optional time. The format of such a string contains one or more of the following fields, in any order: month day, year hours:minutes:seconds For example, the following string: specifies the date, October 13, 1995, and the time, one thirteen and 15 seconds PM, which, expressed in 24-hour time, is 13:13 hours and 15 seconds. The time specification is optional; if it is included, the seconds specification is optional. Syntax forms D and E are self-explanatory. Parameters passed to them are integers. Example |
Siebel eScript Language Reference |