Date/LastModified Question

by Nathan Lyle <natelyle(at)chartermi.net>

 Date:  Wed, 12 Sep 2001 18:54:41 -0400
 To:  javascript <hwg-techniques(at)hwg.org>
  todo: View Thread, Original
I've been trying to use the following script:

        var days = new Array(8);
        days[1] = "Sunday"; etc...

        var months = new Array(13);
        months[1] = "January"; etc...

        var dateObj = new Date(document.lastModified);
        var wday = days[dateObj.getDay() + 1];
        var lmonth = months[dateObj.getMonth() + 1];
        var date = dateObj.getDate();
        var fyear = dateObj.getYear();
        if (fyear < 2000);
        fyear = fyear + 1900;
        document.writeln(wday + ", " + lmonth + " " + date + ", " + fyear);

And find myself getting strange results for the year (a thousand years
off in either direction.)

Any ideas?

~Nathan Lyle   (The Tragic Comedian Poet)

Email: natelyle(at)chartermi.net
Phone: (906)485-4806
  Web: www.nathanlyle.com

"Try this sometime. Get a group of children in a room with a light fixture hanging just out of their grasp. Then watch what happens: one child will jump to touch it, and before you know it, every kid in the room will be leaping like Michael Jordan. They're testing their skill, stimulated by the challenge of reaching something beyond their normal grasp. Put the same children in a room where everything is easily in reach, and there will be no jumping, no competition, no challenges. The problem with American education is a low ceiling of expectations. We have built schools that demand and teach too little, and the children have stopped jumping." - Carroll Campbell

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA