Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Old 05-21-2002, 12:44 AM Java script
DocMoore's Avatar
Novice Talker

Posts: 11
Location: West Virginia
Trades: 0
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
 
 
Register now for full access!
Old 05-21-2002, 01:32 AM
jane1076's Avatar
Average Talker

Posts: 22
Location: New Port Richey, FL
Trades: 0
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
__________________

Please login or register to view this content. Registration is FREE

A Tribute To Our Heroes, the Veterans!
jane1076 is offline
Reply With Quote
View Public Profile
 
Old 05-21-2002, 10:06 AM Is this what you're looking for...
Experienced Talker

Posts: 30
Location: South Dakota
Trades: 0
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.
__________________
Visit and Learn

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
kcwell is offline
Reply With Quote
View Public Profile
 
Old 05-23-2002, 03:06 PM JavaScript Date
kline11's Avatar
SearchBliss Web Tools

Latest Blog Post:
Oracle Embraces the Cloud
Posts: 1,724
Name: John
Location: USA
Trades: 0
Here's a good one. Just cut and paste it.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
kline11 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Java script
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.16596 seconds with 12 queries