Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > Client Side Scripting
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 05-30-2004, 05:38 AM
  #1
cheryl
Soldier (Level 11)
 
cheryl's Avatar
 
Join Date: May 2004
Location: margate kent
Posts: 111
iTrader: (0)
cheryl is on a distinguished road
code needed

What code do i need to use so that the date automatically appears on my web site and changes automatically?
cheryl is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 06-01-2004, 07:15 PM
  #2
olson2189
Battler (Level 3)
 
olson2189's Avatar
 
Join Date: Jun 2004
Location: Chicago
Posts: 23
iTrader: (0)
olson2189 is on a distinguished road
Copy and paste the following script into the body of your webpage. You may need to edit this script, or all you will get is a blank page with today's date.

<SCRIPT LANGUAGE="JavaScript">
var months=new Array(13);
months[1]="January";
months[2]="February";
months[3]="March";
months[4]="April";
months[5]="May";
months[6]="June";
months[7]="July";
months[8]="August";
months[9]="September";
months[10]="October";
months[11]="November";
months[12]="December";
var time=new Date();
var lmonth=months[time.getMonth() + 1];
var date=time.getDate();
var year=time.getYear();
if (year<100) year="19" + time.getYear();
else year=time.getYear();
document.write("<center>" + lmonth + " ");
document.write(date + ", " + year + "</center>");
</SCRIPT>

<!-- END OF SCRIPT -->
olson2189 is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 06-02-2004, 10:05 AM
  #3
agent002
Resident Opera Guru
 
agent002's Avatar
 
Join Date: Feb 2003
Location: Suomi... SUOH-MIH
Posts: 6,454
iTrader: (0)
agent002 is on a distinguished road
Hello Olson2189,
that code doesn't update the clock automatically
The code for that was posted recently here: http://www.htmlforums.com/showthread...threadid=40556

Cheryl - You could maybe think of a little better subjects for your threads (link); something that actually describes the thread instead of simply "Newbie", "Help" and "code needed" (you have used all of those three subjects).
__________________
° · o O oO
agent002 is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 06-02-2004, 11:06 AM
  #4
olson2189
Battler (Level 3)
 
olson2189's Avatar
 
Join Date: Jun 2004
Location: Chicago
Posts: 23
iTrader: (0)
olson2189 is on a distinguished road
Yea, I wasn't exactly sure what she wanted, so I gave her a script that may be of some assistance.
olson2189 is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 06-02-2004, 11:24 AM
  #5
Willy Duitt
Catapulted
 
Willy Duitt's Avatar
 
Join Date: Sep 2003
Posts: 1,108
iTrader: (0)
Willy Duitt is on a distinguished road
Or simply:

Code:
<script type="text/javascript">
document.write(new Date())
</script>
Willy Duitt is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote

Reply
KEEP TABS
SPONSORS
 
Boxedart



 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  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
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 01:16 AM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.