Tutorials to .com

Tutorials to .com » Asp » Encoding » JScript method - getYear method

JScript method - getYear method

Print View , by: iSee ,Total views: 12 ,Word Count: 215 ,Date: Wed, 27 May 2009 Time: 2:11 AM

Date object to return the year value.

dateObj.getYear ()

Options will be for the Date object dateObj parameters.

Description
This method has become obsolete, the reason for this approach is in order to maintain backward compatibility. GetFullYear method to use.

For the period 1900-1999, the return value is a year of double-digit integer, it represents the preservation of the Year and in 1900 the gap between. Of
In other years, the return value is an integer of 4. For example, in 1996 the return value is 96, and 1825 and in 2025 the return value for the corresponding
1825 and 2025.

jscript 1.0 version for the attention, getYear returned Date object is always the value of the year and in 1900 the gap between. For example, the return in 1899
Value is -1, while in 2000 the return value is 100.

Example
The following example illustrates the use of getYear method.

function DateDemo () (
var d, s = "today's date is:";
d = new Date ();
s + = (d.getMonth () + 1) + "/";
s + = d.getDate () + "/";
s + = d.getYear ();
return (s);
)
Request
Version 1


Asp Script encoding Articles


Can't Find What You're Looking For?


Rating: Not yet rated

Comments

No comments posted.