Re: REPOST: Date Scripts
by Thomas James Allen <tjallen(at)pipeline.com>
|
Date: |
Tue, 10 Aug 1999 19:06:46 -0400 |
To: |
<kingben(at)bigfoot.com> |
Cc: |
hwg-basics(at)hwg.org |
|
todo: View
Thread,
Original
|
|
At 11:29 PM 8/9/99 +0100, you wrote:
>On my site I would like to put:
>
>"Today's Highlights on Sunday the 8th of August 1999"
>
<snipped for length>
>Any answers?
>Thankyou to all who reply as any help will be used!
>Ben Bradley UK
----------------------------------------------
Ben,
Try this great little script.
I forgot where I got it, but it's a gem!
You can change the last three lines (the document.write's)
to add your "Today's highlights..."
In the fourth to last line, I see it has a small Y2K problem,
but it's easily fixed on Dec. 31. ( See the + ", 19" )
Hope this helps,
jimmy
--------------------------------------------------
<script language="JavaScript">
<!-- hide script
var now = new Date();
var dd = now.getDate();
var mm = now.getMonth();
var yy = now.getYear();
(mm == 11) ? mm = "December":
(mm == 10) ? mm = "November":
(mm == 9) ? mm = "October":
(mm == 8) ? mm = "September":
(mm == 7) ? mm = "August":
(mm == 6) ? mm = "July":
(mm == 5) ? mm = "June":
(mm == 4) ? mm = "May":
(mm == 3) ? mm = "April":
(mm == 2) ? mm = "March":
(mm == 1) ? mm = "February":
mm = "January";
var CurrentDate = "" + mm + " " + dd + ", 19" + yy;
document.write ("<b><FONT size='2'
face='Arial,Helvetica,Geneva,Swiss,SunSans-Regular' color='#FF0000'>");
document.write (CurrentDate);
document.write ("</FONT></b>");
// -->
</script>
HTML: hwg-basics mailing list archives,
maintained by Webmasters @ IWA