Re: Javascript for Date Last Changed & Y2K
[ Follow Ups ] [ Post Followup ] [ Intranet eXchange ] [ IDM Home ]
Posted by bill palmer on January 8, 2000 at 3:56:13:
In Reply to: Javascript for Date Last Changed & Y2K posted by Paula Gregorowicz on January 4, 2000 at 8:37:22:
Keep in mind that document.lastModified is a text string. The following from your script converts a string into a date object date = new Date(document.lastModified); What is important to realize is that this string looks different in IE vs. NS. IE document.lastModified: "01/07/00 11:28:04" NS document.lastModified: "Friday, January 07, 2000 11:28:04" They are consistent in that the two digit year is 11 positions back from the end. That means that another string expression would work: year=document.lastModified.substr(document.lastModified.length-11,2); BTW:--another idea is to forget formulas and converting to a date object. Just change your pages to print the whole document.lastModified string whatever it may be.
Follow Ups:
|