Specifications
Returns the year using local time.
var d = new Date( 1975, 12, 25 );
var x = d.getYear(); // x == 1975
getYear( ) : Number
Returns the hours using local time. The value is always in the range
0..23
var d = new Date( 1975, 12, 25, 22 );
var x = d.getHours(); // x == 22
getHours( ) : Number
Returns the milliseconds component of the date using local time.
The value is always in the range 0..999. In the example, x is 0,
getMilliseconds( ) :
Number
because no milliseconds were specified, and the default for
unspecified components of the time is 0.
var d = new Date( 1975, 12, 25, 22 );
var x = d.getMilliseconds(); // x == 0
Returns the minutes component of the date using local time. The
value is always in the range 0..59.
var d = new Date( 1975, 12, 25, 22, 30 );
var x = d.getMinutes(); // x == 30
getMinutes( ) : Number
Returns the month component of the date using local time. The
value is always in the range 0..12.
getMonth( ) : Number
Example 1:
var d = new Date( 1975, 12, 25, 22, 30 );
var x = d.getMonth(); // x == 12
Example 2:
var IndexToMonth = [ "Jan", "Feb", "Mar", "Apr", "May",
"Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ];
var d = new Date( 1975, 12, 25 );
var month = IndexToMonth[ d.getMonth() - 1]; // month ==
"Dec"
Returns the seconds component of the date using local time. The
value is always in the range 0..59. In the example x is 0 because no
getSeconds( ) : Number
seconds were specified, and the default for unspecified components
of the time is 0.
var d = new Date( 1975, 12, 25, 22, 30 );
var x = d.getSeconds(); // x == 0
376
Enfocus Switch 10