Bookshelf Home | Contents | Index | PDF | ![]() ![]() |
Siebel eScript Language Reference > Methods Reference > Date and Time Methods > About the Date ConstructorThe Date constructor instantiates a new date object. If you include an argument, then it returns a date object that includes the date according to the argument. To create a date object that Siebel CRM sets to the current date and time, you can use the new operator as you would with any object. Format AFormat Bvar dateVar = new Date(milliseconds); Format Cvar dateVar = new Date(dateString); Format Dvar dateVar = new Date(year, month, day); Format Evar dateVar = new Date(year, month, day, hours, minutes, seconds); ArgumentsTable 62 describes arguments for the date constructor.
Usage for Format BFormat B returns a date and time that includes the number of milliseconds since midnight, January 1, 1970. Using milliseconds is a standard way of including dates and times. It simplifies calculating the amount of time between one date and another. It is recommended that you configure Siebel CRM to convert a date to milliseconds before it performs a calculation on the date. Usage for Format CFormat C accepts a string that includes a date and an optional time. The format for this string includes one or more of the following fields, in any order: month day, year hours:minutes:seconds This string specifies a date of October 13, 1995 and a time of one thirteen and 15 seconds PM. In a 24 hour format, this value is 13:13 hours and 15 seconds. The time specification is optional. If you include it, then the seconds specification is optional. Siebel CRM can pass the result of the BusComp.GetFieldValue(datetime field) method to the date constructor. The GetFieldValue method always returns date fields using the following format: Siebel CRM interprets the time in a date string as local time, according to the time zone setting of the operating system. If you require Siebel CRM to interpret the time as UTC time, then you can append GMT to the date string. For example: If a business component field includes a UTC time rather than a local time, then you can append GMT to the code to configure Siebel CRM to pass is to the date constructor. For example: var utctime = new Date(GetFieldValue("UTC Time") + " GMT"); Usage for Format D and EFormat for formats D and E are self-explanatory. You configure Siebel CRM to pass arguments to them as integers. ExampleThe following example includes a date constructor: var aDate = new Date(1802, 6, 23) This example creates a date object that contains a date of July 23, 1802. |
![]() ![]() |
Siebel eScript Language Reference | Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Legal Notices. | |