Microsoft® JScript™ getUTCFullYear Method | Language Reference Version 3

See Also Applies To

##### Description

> Returns the year stored in a Date object according to Universal Coordinated Time (UTC).

##### Syntax

> objDate.getUTCFullYear()

##### Remarks

> To get the year according to local time, use the getFullYear method.

> The getUTCFullYear method returns the year as an absolute number. This avoids problems with dates occurring at the end of the 20th century.

> The following example illustrates the use of the getUTCFullYear method:

> >     function UTCDateDemo()
> >     {
> >       var d, s = "Today's UTC date is: ";
> >       d = new Date();
> >       s += (d.getUTCMonth() + 1) + "/";
> >       s += d.getUTCDate() + "/";
> >       s += d.getUTCFullYear();
> >       return(s);
> >     }

© 1998 Microsoft Corporation. All rights reserved. Terms of Use.