å·²å¼ç¨: ä¸åæ¨è使ç¨è¯¥ç¹æ§ãè½ç¶ä¸äºæµè§å¨ä»ç¶æ¯æå®ï¼ä½ä¹è®¸å·²ä»ç¸å ³ç web æ åä¸ç§»é¤ï¼ä¹è®¸æ£åå¤ç§»é¤æåºäºå ¼å®¹æ§èä¿çã请尽éä¸è¦ä½¿ç¨è¯¥ç¹æ§ï¼å¹¶æ´æ°ç°æç代ç ï¼åè§æ¬é¡µé¢åºé¨çå ¼å®¹æ§è¡¨æ ¼ä»¥æå¯¼ä½ ä½åºå³å®ã请注æï¼è¯¥ç¹æ§éæ¶å¯è½æ æ³æ£å¸¸å·¥ä½ã
getYear()
æ¹æ³è¿åæå®çæ¬å°æ¥æç年份ãå 为 getYear()
ä¸è¿åå禧年ï¼"year 2000 problem"ï¼ï¼æä»¥è¿ä¸ªæ¹æ³ä¸å被使ç¨ï¼ç°å¨æ¿æ¢ä¸º getFullYear
ã
getYear
æ¹æ³è¿åä¸ä¸ªå¹´ä»½åå» 1900 çå¼ï¼å æ¤ï¼
getYear()
çè¿åå¼å°å¤§äºçäº 100ãä¾å¦ï¼å¦æå¹´ä»½æ¯ 2026ï¼å getYear()
è¿å 126ãgetYear()
çè¿åå¼å°å¨ 0 å° 99 ä¹é´ãä¾å¦ï¼å¦æå¹´ä»½æ¯ 1976ï¼å getYear()
è¿å 76ãgetYear()
çè¿åå¼å°å°äº 0ãä¾å¦ï¼å¦æå¹´ä»½æ¯ 1800ï¼å getYear()
è¿å -100ã妿è¦åæ¶èè 2000 å¹´ä¹ååä¹åç年份ï¼åºè¯¥ä½¿ç¨ getFullYear()
è䏿¯ getYear()
ï¼ä»¥ä¾¿æå®å®æ´å¹´ä»½ã
The getYear
method returns either a 2-digit or 4-digit year:
getYear
is the year minus 1900. For example, if the year is 1976, the value returned is 76.getYear
is the four-digit year. For example, if the year is 1856, the value returned is 1856. If the year is 2026, the value returned is 2026.The second statement assigns the value 95 to the variable year
.
var Xmas = new Date("December 25, 1995 23:15:00");
var year = Xmas.getYear(); // returns 95
å¹´ä»½å¤§äº 1999
The second statement assigns the value 100 to the variable year
.
var Xmas = new Date("December 25, 2000 23:15:00");
var year = Xmas.getYear(); // returns 100
年份å°äº 1900
The second statement assigns the value -100 to the variable year
.
var Xmas = new Date("December 25, 1800 23:15:00");
var year = Xmas.getYear(); // returns -100
设置åè·å 1900 å¹´å° 1999 å¹´ä¹é´ç年份
The second statement assigns the value 95 to the variable year
, representing the year 1995.
var Xmas.setYear(95);
var year = Xmas.getYear(); // returns 95
è§è æµè§å¨å
¼å®¹æ§ åè§
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4