Bookshelf Home | Contents | Index | Search | PDF |
Siebel eScript Language Reference > Siebel eScript Commands > The Date Object >
setMilliseconds() Method
This method sets the millisecond of a Date object to a date expressed in milliseconds relative to the system time.
Syntax
dateVar.setMilliseconds(millisecond)
Parameter Description millisecond The millisecond to which dateVar should be set as a positive or negative integerReturns
Not applicable
Usage
This method sets the millisecond of dateVar to millisecond. The value of dateVar becomes equivalent to the number of milliseconds from the time on the system clock. Use a positive number for later times, a negative number for earlier times.
Example
This example accepts a number of milliseconds as input and converts it to the date relative to the date and time on the system clock. The illustration shows the result of entering 0 on November 22, 1999.
function test2_Click ()
{
var aDate = new Date;
var milli = 20000000;
aDate.setMilliseconds(milli);
var aYear = aDate.getFullYear();
var aMonth = aDate.getMonth() + 1;
var aDay = aDate.getDate();
var anHour = aDate.getHours();switch(anHour)
{
case 0:
anHour = " 12 midnight.";
break;
case 12:
anHour = " 12 noon.";
break;
default:
if (anHour > 11 )
anHour = (anHour - 12 ) + " P.M.";
else
anHour = anHour + " A.M.";
}TheApplication().RaiseErrorText("The specified date is " + aMonth + "/" + aDay + "/" + aYear + " at " + anHour);
}See Also
getMilliseconds() Method, setTime() Method, and setUTCMilliseconds() Method
Bookshelf Home | Contents | Index | Search | PDF |
Siebel eScript Language Reference Published: 18 April 2003 |