Fw: Javascript: validation and time/date format

by "Nick Doylend" <ndoylend(at)hashishin.net>

 Date:  Mon, 13 Nov 2000 22:41:37 -0000
 To:  <hwg-techniques(at)mail.hwg.org>
  todo: View Thread, Original
Great stuff, thanks for your help everybody!

I've now got the following script which validates OK and seems to display
the date as I want it.  I guess getMonth() returns 0 for January hence
adding 1 to get the true month.  The real test will be to see if it works
say tomorrow or next month or on some one else's computer!

  mdate = new Date (document.lastModified);
  year = mdate.getYear();
  month = mdate.getMonth() + 1;
  date = mdate.getDate();
  document.write("<I>" + "Last updated: " + date + "/" + month + "/" + year
+ "<\/I>");

Thanks again, Nick

----- Original Message -----
From: Nick Doylend <ndoylend(at)hashishin.net>
To: <hwg-techniques(at)mail.hwg.org>
Sent: Monday, November 13, 2000 12:21 AM
Subject: Javascript: validation and time/date format


> Hi, just trying to get a document to validate correctly but I get the
> following error when it comes to a tiny bit of JavaScript at the foot of
the
> page:
>
> document.write("<I>Last updated: "+ document.lastModified +"</I>");
>
> Error: end tag for element "I" which is not open
>
> Also does anyone know an easy(ish) way of manipulating the data in
> "document.lastModified"?  I want to remove the time and just have the
date,
> I also want to the date in DD/MM/YYYY format rather than daft MM/DD/YYYY
> format!
>
> Thanks very much for your help,
>
> Nick Doylend
>

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