JavaScript Reference/Javascript Methods/getYear — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 11:22, 26 мая 2010
"getYear()" Example
<source lang="javascript">
<html> <body> <button onclick="var myDate = new Date(); alert(myDate.getYear());">get year</button> </body> </html>
</source>
"getYear()" is applied to
<source lang="javascript">
+----------------+--------------------------------------------------------------+ | Applied_To |Date | +----------------+--------------------------------------------------------------+
</source>
"getYear()" Syntax, Parameters and Note
<source lang="javascript">
Note: Returns the year. When the year is before 2000, the return value is the year minus 1900. When the year is 2000 or after, the return value is the four-digit year.
Syntax:
dateName.getYear()
</source>