tintinape — 2011-06-26T15:53:50-04:00 — #1
Hello bros and sis's,
I'm a newbie. I've got this function that renders the current calendar year in a browser. In IE, the year "2011" shows up, but nothing shows up in Firefox 3.6.17, wonder if someone could help me figure out why and how to fix it.
var _today = new Date();
var _year = _today.getYear();
if (_year < 200) _year += 1900;
currdate = new Date;
Thanks in advance. [Pardon me for the typo in the title of this post.]
felgall — 2011-06-26T17:06:44-04:00 — #2
getYear() is not Y2K compliant. It will return different results in different browsers for years from 2000 onwards. It should not be used.
That doesn't explain why the date isn't showing though as it is only the last two lines within that script that are actually being used to display the year in the page. Possibly something elsewhere in the page is interfering.
paul_wilkins — 2011-06-26T18:36:39-04:00 — #3
The script type text/jscript is proprietary to Microsoft's Internet Explorer web browser.
felgall — 2011-06-26T22:15:03-04:00 — #4
paul_wilkins — 2011-06-26T22:58:06-04:00 — #5
system — 2011-06-27T00:50:04-04:00 — #6