Current Date And Time Installation (Full Version)

All Forums >> [Web Development] >> Computer Software and Hardware issues



Message


SilverHD -> 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. -> 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>




SilverHD -> RE: Current Date And Time Installation (12/13/2004 14:31:16)

Thanks Larry, your help is appreciated!

Silver




Larry M. -> RE: Current Date And Time Installation (12/13/2004 14:44:39)

quote:

Thanks Larry, your help is appreciated!


SilverHD,

You are most welcome[&:].

Get back to us for "fine tuning" if you need to modify this script with changes to the font style/size and/or color.

Correction: the above script will Display as Month/Day/Year (space) Hour/Minute (a.m. or p.m.)




dpf -> RE: Current Date And Time Installation (12/13/2004 14:48:42)

Larry's script does some nice formating. a simpler way is just this
quote:

Stamp = new Date();
document.write(Stamp):

it would return(print) this:
Mon Dec 13 14:45:15 EST 2004




Larry M. -> RE: Current Date And Time Installation (12/13/2004 14:50:56)

Dan,

Looks neat. How/where do you insert?




dpf -> 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




Larry M. -> RE: Current Date And Time Installation (12/13/2004 20:01:10)

Dan,

Slick!




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.03125