Siebel eScript Language Reference > Siebel eScript Commands > The Date Object >

setUTCFullYear() Method


This method sets the UTC year of a Date object to a specified four-digit year.

Syntax

dateVar.setUTCFullYear(year[, month[, date]])

Parameter
Description
year
The UTC year to which to set dateVar as a four-digit integer
month
The UTC month to which to set year as an integer from 0 to 11
date
The UTC date of month to which to set dateVar as an integer from 1 to 31

Returns

Not applicable

Usage

This method sets the UTC year of dateVar to year. Optionally, it can set the UTC month of year to month, and the UTC date of month to date. The year must be expressed in four digits.

Example

The following example uses the setUTCFullYear method to assign the date of the 2000 summer solstice and the setUTCHours method to assign its time to a Date object. Then it determines the local date and displays it as shown in the illustration following the example.

function dateBtn_Click ()
{
   var Mstring = " A.M., Standard Time.";
   var solstice2K = new Date;
   solstice2K.setUTCFullYear(2000, 5, 21);
   solstice2K.setUTCHours(01, 48);
   var localDate = solstice2K.toLocaleString();
   var pos = localDate.indexOf("2000")
   var localDay = localDate.substring(0, pos - 10);

   var localHr = solstice2K.getHours();
   if (localHr > 11 )
   {
      localHr = (localHr - 12 );
      Mstring = " P.M., Standard Time.";
   }
   var localMin = solstice2K.getMinutes();

   var msg = "In your location, the solstice is on " + localDay +
      ", at " + localHr + ":" + localMin + Mstring;
   TheApplication().RaiseErrorText(msg);
}

See Also

Universal Time Functions, getUTCFullYear() Method, setFullYear() Method, and setYear() Method


 Siebel eScript Language Reference 
 Published: 18 April 2003