Reply
Java script
Old 05-20-2002, 11:44 PM Java script
DocMoore's Avatar
Novice Talker

Posts: 11
Location: West Virginia
Can someone tell me a good script for putting the current date on a web site?

I would like to have it like Wednesday, March 20, 2002.
DocMoore is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 05-21-2002, 12:32 AM
jane1076's Avatar
Average Talker

Posts: 22
Location: New Port Richey, FL
I'm not sure if this is what you're looking for,but here's a link I found.

http://javascript.internet.com/calendars/

They had several different things there that displayed the date.
Jane
__________________
God Bless Our Heroes
A Tribute To Our Heroes, the Veterans!
jane1076 is offline
Reply With Quote
View Public Profile Visit jane1076's homepage!
 
Old 05-21-2002, 09:06 AM Is this what you're looking for...
Experienced Talker

Posts: 30
Location: South Dakota
This is what I use...

Place the following code in the HEAD of your document:

<SCRIPT LANGUAGE="JavaScript">

<!-- This script and many more are available online from -->
<!-- The JavaScript Source!! http://javascriptsource.com -->

<!-- Begin
var day="";
var month="";
var myweekday="";
var year="";
mydate = new Date();
myday = mydate.getDay();
mymonth = mydate.getMonth();
myweekday= mydate.getDate();
weekday= myweekday;
myyear= mydate.getYear();
year = myyear
if(myday == 0)
day = " Sunday, "
else if(myday == 1)
day = " Monday, "
else if(myday == 2)
day = " Tuesday, "
else if(myday == 3)
day = " Wednesday, "
else if(myday == 4)
day = " Thursday, "
else if(myday == 5)
day = " Friday, "
else if(myday == 6)
day = " Saturday, "
if(mymonth == 0) {
month = "January "}
else if(mymonth ==1)
month = "February "
else if(mymonth ==2)
month = "March "
else if(mymonth ==3)
month = "April "
else if(mymonth ==4)
month = "May "
else if(mymonth ==5)
month = "June "
else if(mymonth ==6)
month = "July "
else if(mymonth ==7)
month = "August "
else if(mymonth ==8)
month = "September "
else if(mymonth ==9)
month = "October "
else if(mymonth ==10)
month = "November "
else if(mymonth ==11)
month = "December "
// End -->
</SCRIPT>

Then place this code in the BODY of the document.

<SCRIPT>
document.write("<font color='003300'><p align=center><font size=-1>" + day + month);
document.write(myweekday + ", " + year + "</font>");
</SCRIPT>

I left a little formating in the code so you can see how you can adjust the look of it.

Hope this helps.
kcwell is offline
Reply With Quote
View Public Profile Visit kcwell's homepage!
 
Old 05-23-2002, 02:06 PM JavaScript Date
kline11's Avatar
King Spam Talker

Posts: 1,262
Name: John
Location: USA
Here's a good one. Just cut and paste it.
kline11 is offline
Reply With Quote
View Public Profile Visit kline11's homepage!
 
Reply     « Reply to Java script
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13175 seconds with 13 queries