Siebel eScript Language Reference > Siebel eScript Commands > Date and Time Methods >

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 integer

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 in the computer's clock.

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);
}

If you enter 0 on November 22, 1999, you get the following result.

The specified date is 11/22/1999 at 5 P.M.

See Also

getMilliseconds() Method
setTime() Method
setUTCMilliseconds() Method

Siebel eScript Language Reference