Microsoft® JScript™ getFullYear Method | Language Reference Version 3

See Also Applies To

##### Description

> Returns the year stored in the Date object according to local time.

##### Syntax

> objDate.getFullYear()

##### Remarks

> To get the year according to Universal Coordinated Time (UTC), use the getUTCFullYear method.

> The getFullYear method returns the year as an absolute number. For example, the year 1976 is returned as 1976. This avoids problems with dates occuring at the end of the 20th century.

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

> >     function DateDemo()
> >     {
> >       var d, s = "Today's UTC date is: ";
> >       d = new Date();
> >       s += (d.getMonth() + 1) + "/";
> >       s += d.getDate() + "/";
> >       s += d.getFullYear();
> >       return(s);
> >     }

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