|
| |
|
|
SilverHD
Posts: 2 Joined: 12/12/2004 Status: offline
|
Current Date And Time Installation - 12/12/2004 21:11:05
Can someone tell me how to install the current date and time via FrontPage 2002? Or for that matter any way that you know. Thanks much, Silver
|
|
|
|
Larry M.
Posts: 2711 Joined: 2/20/2003 From: Greenville, South Carolina, USA Status: offline
|
RE: Current Date And Time Installation - 12/13/2004 10:11:55
Silver, The script below displays as Month/Day/ (space) Hour/Minute a.m. or p.m. Copy Script, Position cursor then >>Insert >>Web Component >>Advanced Controls >>HTML >>Paste Script. Will display in Preview Mode prior to Publishing. <SCRIPT LANGUAGE="JavaScript"> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> <!-- Begin Stamp = new Date(); year = Stamp.getYear(); if (year < 2000) year = 1900 + year; document.write('<font size="2" face="Arial"><B>' + (Stamp.getMonth() + 1) +"/"+Stamp.getDate()+ "/"+ year + '</B></font><BR>'); var Hours; var Mins; var Time; Hours = Stamp.getHours(); if (Hours >= 12) { Time = " P.M."; } else { Time = " A.M."; } if (Hours > 12) { Hours -= 12; } if (Hours == 0) { Hours = 12; } Mins = Stamp.getMinutes(); if (Mins < 10) { Mins = "0" + Mins; } document.write('<font size="2" face="Arial"><B>' + Hours + ":" + Mins + Time + '</B></font>'); // End --> </SCRIPT>
_____________________________
Larry M. Indecision is the Key to Flexibility.
|
|
|
|
SilverHD
Posts: 2 Joined: 12/12/2004 Status: offline
|
RE: Current Date And Time Installation - 12/13/2004 14:31:16
Thanks Larry, your help is appreciated! Silver
|
|
|
|
dpf
Posts: 7121 Joined: 11/12/2003 From: India-napolis Status: offline
|
RE: Current Date And Time Installation - 12/13/2004 14:48:42
Larry's script does some nice formating. a simpler way is just thisquote:
Stamp = new Date(); document.write(Stamp): it would return(print) this: Mon Dec 13 14:45:15 EST 2004
_____________________________
Dan
|
|
|
|
Larry M.
Posts: 2711 Joined: 2/20/2003 From: Greenville, South Carolina, USA Status: offline
|
RE: Current Date And Time Installation - 12/13/2004 14:50:56
Dan, Looks neat. How/where do you insert?
_____________________________
Larry M. Indecision is the Key to Flexibility.
|
|
|
|
dpf
Posts: 7121 Joined: 11/12/2003 From: India-napolis Status: offline
|
RE: Current Date And Time Installation - 12/13/2004 15:03:07
Larry: put this in your page where you want it. <script type="text/javascript" language="javascript" Stamp = new Date(); document.write(Stamp): </script> for example, this code <html>
<head>
<title>JavaScript Test</title>
</head>
<body >
<h1> Todays date is
<script type="text/javascript">
<!--
stamp = new Date();
document.write(stamp);
//-->
</script>
</h1>
</body>
</html>
produced this Todays date is Mon Dec 13 14:50:07 EST 2004
_____________________________
Dan
|
|
|
|
Larry M.
Posts: 2711 Joined: 2/20/2003 From: Greenville, South Carolina, USA Status: offline
|
RE: Current Date And Time Installation - 12/13/2004 20:01:10
Dan, Slick!
_____________________________
Larry M. Indecision is the Key to Flexibility.
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|