File:JavaScript getYear Method Problem.png
Summary
Description |
English: Webpage screenshots showing the JavaScript .getYear method problem. It depicts the so-called Year 2000 problem.
The results of the .getYear method are different with Internet Explorer 6-8 and the other modern browsers:
.getYear is now obsoleted, but supported for backward compatibility by all modern browsers. .getFullYear is not supported before IE6. With those that support it, the 4-digit full year is always returned. This method is currently recommended.
BTW, if you want to return a 2-digit year value (only for AD, 3, 203, 1803, 1903 and 2003 all return "03", that are the last two digits) in modern browsers, you may try: ("0"+dateObj.getFullYear().toString()).slice(-2);
References: |
||
Date | |||
Source | Own work | ||
Author | Tomchen1989 |
Licensing
I, the copyright holder of this work, hereby publish it under the following license:
![]() ![]() |
This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication. |
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.
|