Re: Date Format
by "Stephanie Thrasher" <steph(at)omsoft.com>
|
Date: |
Mon, 3 Jun 2002 09:10:48 -0700 |
To: |
"David Artiss" <david(at)artiss.co.uk>, <hwg-languages(at)hwg.org> |
References: |
kl19a |
|
todo: View
Thread,
Original
|
|
Hi David,
I think this will do it:
var date = now.getDate();
var dateName;
if (date == 1) dateName = "1st";
if (date == 2) dateName = "2nd";
if (date == 3) dateName = "3rd";
if (date == 4) dateName = "4th";
...etc.
document.write(dayName[now.getDay()] + ", " + monName[now.getMonth()] + " "
+ dateName);
Stephanie
> Hi !
>
> I think I'm suffering from more brain fade today. A while ago I got a
script
> from a site which displays the current date. It can be found at...
>
> http://www.artiss71.fsworld.co.uk/date.html
>
> It displays the date in the format "Monday, June 3". I'd like to make this
a
> little more user-friendly by adding the appropriate suffix onto the end of
> the day - e.g. "Monday, June 3rd". However, I've been unable to work out
> how. If anybody can assist it will be appreciated.
>
> David.
>
>
>
HWG: hwg-languages mailing list archives,
maintained by Webmasters @ IWA