Font change in a Script

D

Don Schmidt

Hi gang,

'Been doing a little tweaking with my website; added a Day and Date to the
Home page.

I'd like to change the font from what looks like Times New Roman to Verdana;
How?

Here is the Script:

<SCRIPT LANGUAGE="Javascript"><!--

// ***********************************************
// AUTHOR: WWW.CGISCRIPT.NET, LLC
// URL: http://www.cgiscript.net
// Use the script, just leave this message intact.
// Download your FREE CGI/Perl Scripts today!
// ( http://www.cgiscript.net/scripts.htm )
// ***********************************************

// Get today's current date.
var now = new Date();

// Array list of days.
var days = new
Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');

// Array list of months.
var months = new
Array('January','February','March','April','May','June','July','August','September','October','November','December');

// Calculate the number of the current day in the week.
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();

// Calculate four digit year.
function fourdigits(number) {
return (number < 1000) ? number + 1900 : number;
}

// Join it all together
today = days[now.getDay()] + ", " +
months[now.getMonth()] + " " +
date + ", " +
(fourdigits(now.getYear())) ;

// Print out the data.
document.write("Today is " +today+ ".");

//--></SCRIPT>

Many thanks,
 
S

Spike

Don

Change the line:

document.write("Today is " +today+ ".");

TO READ:

document.write("<b><font size= 4 face= verdana> Today is " +today+ ".");

Monkey around with the font name (face) and the size

Spike
 
S

Spike

Have you tried an ACTIVE clock that shows actual time and updates each
second?

ADD: onLoad="show_clock()" after <body tag

<body onLoad="show_clock()" ......

Html fragment in publisher to where you want the time to show

<script language="javascript" src="liveclock.js">

/*
Live Clock Script-
By Mark Plachetta ([email protected]©) based on code from
DynamicDrive.com
For full source code, 100's more DHTML scripts, and Terms Of Use,
visit http://www.dynamicdrive.com
*/

</script>

Download liveclock.js from
http://www.dynamicdrive.com

Put js file in same folder with page


Spike
 
D

Don Schmidt

Many thanks Spike.

This is the line I ended up with:

document.write("<font size= 2 face= verdana> Today is " +today+ ".");

'Eliminated the Bold; got a number 10 font with the 2



I'll look into the clock script. I have a pocket watch icon on my test site

http://www.iinet.com/~defcon_one/

Don



Spike said:
Don

Change the line:

document.write("Today is " +today+ ".");

TO READ:

document.write("<b><font size= 4 face= verdana> Today is " +today+ ".");

Monkey around with the font name (face) and the size

Spike


Don Schmidt said:
Hi gang,

'Been doing a little tweaking with my website; added a Day and Date to
the Home page.

I'd like to change the font from what looks like Times New Roman to
Verdana; How?

Here is the Script:

<SCRIPT LANGUAGE="Javascript"><!--

// ***********************************************
// AUTHOR: WWW.CGISCRIPT.NET, LLC
// URL: http://www.cgiscript.net
// Use the script, just leave this message intact.
// Download your FREE CGI/Perl Scripts today!
// ( http://www.cgiscript.net/scripts.htm )
// ***********************************************

// Get today's current date.
var now = new Date();

// Array list of days.
var days = new
Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');

// Array list of months.
var months = new
Array('January','February','March','April','May','June','July','August','September','October','November','December');

// Calculate the number of the current day in the week.
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();

// Calculate four digit year.
function fourdigits(number) {
return (number < 1000) ? number + 1900 : number;
}

// Join it all together
today = days[now.getDay()] + ", " +
months[now.getMonth()] + " " +
date + ", " +
(fourdigits(now.getYear())) ;

// Print out the data.
document.write("Today is " +today+ ".");

//--></SCRIPT>

Many thanks,
 
D

Don Schmidt

Spike,

I'm trying to add the time and date script but it's not working.

I've uploaded liveclock.js to reside next to the html files.
Added the Code fragment to the webpage.

And put the Load instruction in, i.e.,

Original = <body bgcolor="#f9ffd7" link="#000080" vlink="#660099"
text="#000000" topmargin=0 leftmargin=0>
New = <onLoad="show_clock()" body bgcolor="#f9ffd7" link="#000080"
vlink="#660099" text="#000000" topmargin=0 leftmargin=0>

But the time and date aren't showing up on the webpage.

Puzzling. Do you see any problems?

don


Spike said:
Have you tried an ACTIVE clock that shows actual time and updates each
second?

ADD: onLoad="show_clock()" after <body tag

<body onLoad="show_clock()" ......

Html fragment in publisher to where you want the time to show

<script language="javascript" src="liveclock.js">

/*
Live Clock Script-
By Mark Plachetta ([email protected]©) based on code from
DynamicDrive.com
For full source code, 100's more DHTML scripts, and Terms Of Use,
visit http://www.dynamicdrive.com
*/

</script>

Download liveclock.js from
http://www.dynamicdrive.com

Put js file in same folder with page


Spike



Don Schmidt said:
Hi gang,

'Been doing a little tweaking with my website; added a Day and Date to
the Home page.

I'd like to change the font from what looks like Times New Roman to
Verdana; How?

Here is the Script:

<SCRIPT LANGUAGE="Javascript"><!--

// ***********************************************
// AUTHOR: WWW.CGISCRIPT.NET, LLC
// URL: http://www.cgiscript.net
// Use the script, just leave this message intact.
// Download your FREE CGI/Perl Scripts today!
// ( http://www.cgiscript.net/scripts.htm )
// ***********************************************

// Get today's current date.
var now = new Date();

// Array list of days.
var days = new
Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');

// Array list of months.
var months = new
Array('January','February','March','April','May','June','July','August','September','October','November','December');

// Calculate the number of the current day in the week.
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();

// Calculate four digit year.
function fourdigits(number) {
return (number < 1000) ? number + 1900 : number;
}

// Join it all together
today = days[now.getDay()] + ", " +
months[now.getMonth()] + " " +
date + ", " +
(fourdigits(now.getYear())) ;

// Print out the data.
document.write("Today is " +today+ ".");

//--></SCRIPT>

Many thanks,
 
S

Spike

Oops!

You put in

New = <onLoad="show_clock()" body bgcolor="#f9ffd7" link="#000080"
vlink="#660099" text="#000000" topmargin=0 leftmargin=0>

Should be

New = <body onLoad="show_clock()" bgcolor="#f9ffd7" link="#000080"
vlink="#660099" text="#000000" topmargin=0 leftmargin=0>

Spike


Don Schmidt said:
Spike,

I'm trying to add the time and date script but it's not working.

I've uploaded liveclock.js to reside next to the html files.
Added the Code fragment to the webpage.

And put the Load instruction in, i.e.,

Original = <body bgcolor="#f9ffd7" link="#000080" vlink="#660099"
text="#000000" topmargin=0 leftmargin=0>
New = <onLoad="show_clock()" body bgcolor="#f9ffd7" link="#000080"
vlink="#660099" text="#000000" topmargin=0 leftmargin=0>

But the time and date aren't showing up on the webpage.

Puzzling. Do you see any problems?

don


Spike said:
Have you tried an ACTIVE clock that shows actual time and updates each
second?

ADD: onLoad="show_clock()" after <body tag

<body onLoad="show_clock()" ......

Html fragment in publisher to where you want the time to show

<script language="javascript" src="liveclock.js">

/*
Live Clock Script-
By Mark Plachetta ([email protected]©) based on code from
DynamicDrive.com
For full source code, 100's more DHTML scripts, and Terms Of Use,
visit http://www.dynamicdrive.com
*/

</script>

Download liveclock.js from
http://www.dynamicdrive.com

Put js file in same folder with page


Spike



Don Schmidt said:
Hi gang,

'Been doing a little tweaking with my website; added a Day and Date to
the Home page.

I'd like to change the font from what looks like Times New Roman to
Verdana; How?

Here is the Script:

<SCRIPT LANGUAGE="Javascript"><!--

// ***********************************************
// AUTHOR: WWW.CGISCRIPT.NET, LLC
// URL: http://www.cgiscript.net
// Use the script, just leave this message intact.
// Download your FREE CGI/Perl Scripts today!
// ( http://www.cgiscript.net/scripts.htm )
// ***********************************************

// Get today's current date.
var now = new Date();

// Array list of days.
var days = new
Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');

// Array list of months.
var months = new
Array('January','February','March','April','May','June','July','August','September','October','November','December');

// Calculate the number of the current day in the week.
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();

// Calculate four digit year.
function fourdigits(number) {
return (number < 1000) ? number + 1900 : number;
}

// Join it all together
today = days[now.getDay()] + ", " +
months[now.getMonth()] + " " +
date + ", " +
(fourdigits(now.getYear())) ;

// Print out the data.
document.write("Today is " +today+ ".");

//--></SCRIPT>

Many thanks,
 
D

Don Schmidt

In the meantime I found a script that gives date and time totally built in
the script.

www.vanusa.org shows on the home page.

It gets the date and time from the computer displaying the webpage.

don


Spike said:
Oops!

You put in

New = <onLoad="show_clock()" body bgcolor="#f9ffd7" link="#000080"
vlink="#660099" text="#000000" topmargin=0 leftmargin=0>

Should be

New = <body onLoad="show_clock()" bgcolor="#f9ffd7" link="#000080"
vlink="#660099" text="#000000" topmargin=0 leftmargin=0>

Spike


Don Schmidt said:
Spike,

I'm trying to add the time and date script but it's not working.

I've uploaded liveclock.js to reside next to the html files.
Added the Code fragment to the webpage.

And put the Load instruction in, i.e.,

Original = <body bgcolor="#f9ffd7" link="#000080" vlink="#660099"
text="#000000" topmargin=0 leftmargin=0>
New = <onLoad="show_clock()" body bgcolor="#f9ffd7" link="#000080"
vlink="#660099" text="#000000" topmargin=0 leftmargin=0>

But the time and date aren't showing up on the webpage.

Puzzling. Do you see any problems?

don


Spike said:
Have you tried an ACTIVE clock that shows actual time and updates each
second?

ADD: onLoad="show_clock()" after <body tag

<body onLoad="show_clock()" ......

Html fragment in publisher to where you want the time to show

<script language="javascript" src="liveclock.js">

/*
Live Clock Script-
By Mark Plachetta ([email protected]©) based on code from
DynamicDrive.com
For full source code, 100's more DHTML scripts, and Terms Of Use,
visit http://www.dynamicdrive.com
*/

</script>

Download liveclock.js from
http://www.dynamicdrive.com

Put js file in same folder with page


Spike



Hi gang,

'Been doing a little tweaking with my website; added a Day and Date to
the Home page.

I'd like to change the font from what looks like Times New Roman to
Verdana; How?

Here is the Script:

<SCRIPT LANGUAGE="Javascript"><!--

// ***********************************************
// AUTHOR: WWW.CGISCRIPT.NET, LLC
// URL: http://www.cgiscript.net
// Use the script, just leave this message intact.
// Download your FREE CGI/Perl Scripts today!
// ( http://www.cgiscript.net/scripts.htm )
// ***********************************************

// Get today's current date.
var now = new Date();

// Array list of days.
var days = new
Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');

// Array list of months.
var months = new
Array('January','February','March','April','May','June','July','August','September','October','November','December');

// Calculate the number of the current day in the week.
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();

// Calculate four digit year.
function fourdigits(number) {
return (number < 1000) ? number + 1900 : number;
}

// Join it all together
today = days[now.getDay()] + ", " +
months[now.getMonth()] + " " +
date + ", " +
(fourdigits(now.getYear())) ;

// Print out the data.
document.write("Today is " +today+ ".");

//--></SCRIPT>

Many thanks,
 
S

Spike

Don

Here are three scripts that you might want for your test page

No extra codes needed one of them needs countdown.js in web page folder

Have fun

Spike

=====================================================
<script language="JavaScript">
TargetDate = new Date();
BackColor = "transparent";
ForeColor = "navy";
CountActive = true;
CountStepper = 1;
LeadingZero = true;
DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds.";
FinishMessage = "It is finally here!";
</script>
<script language="JavaScript" src="countdown.js"></script>

=====================================================
=====================================================

<SCRIPT Language="JavaScript">

<!--
// Week of the year script - By Ada Shimar ([email protected])
// Based on code by Duncan Kabinu, Florida Department of Agriculture.
// Modified by Italian anonimous on 19.08.2002
// Visit JavaScript Kit (http://javascriptkit.com) for this script and 400+
more

function weekNo() {
var totalDays = 0;
now = new Date();
years=now.getYear();
var days = new Array(12); // Array to hold the total days in a month
days[0] = 31;
days[2] = 31;
days[3] = 30;
days[4] = 31;
days[5] = 30;
days[6] = 31;
days[7] = 31;
days[8] = 30;
days[9] = 31;
days[10] = 30;
days[11] = 31;

// Check to see if this is a leap year
if (Math.round(now.getYear()/4) == now.getYear()/4) {
days[1] = 29
}else{
days[1] = 28
}

// If this is January no need for any fancy calculation otherwise figure out
the
// total number of days to date and then determine what week
if (now.getMonth() == 0) {
totalDays = totalDays + now.getDate();
}else{
var curMonth = now.getMonth();
for (var count = 1; count <= curMonth; count++) {
totalDays = totalDays + days[count - 1];
}
totalDays = totalDays + now.getDate();
}
// Here is the modification: considering when start the 1st week of year.
// Originally was only: var week = Math.round(totalDays/7)
// Check if browser is "Microsoft Internet Explorer" or not and apply the
right var
var agt=navigator.userAgent.toLowerCase();
if ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)) {
var firstday=new Date("01/01/"+String(now.getYear())).getDay();
}
else {
var firstday=new Date("01/01/"+String(1900+now.getYear())).getDay();
}
var diff=7-firstday+1;
var week = Math.round((totalDays+diff-firstday)/7); return week;
}

document.write("Welcome to <b>week "+weekNo()+"<\/b> of "+years+"!")
// -->
</SCRIPT>

=====================================================
=====================================================

<script language="JavaScript">

/*
Plain English Time
By Adam Brown ([email protected])
For this script and more,
Visit http://javascriptkit.com
*/

function number(x) {
if (x==1) return "one"; if (x==2) return "two"; if (x==3) return "three";
if (x==4) return "four"; if (x==5) return "five"; if (x==6) return "six";
if (x==7) return "seven"; if (x==8) return "eight"; if (x==9) return "nine";
if (x==10) return "ten"; if (x==11) return "eleven"; if (x==12) return
"twelve";
return x; //default
}
function ishtime(h,m) {
h = number(h)
if (m<=3 || m>57) return h+" o'clock";
if (m<=7) return "five past "+h;
if (m<=12) return "ten past "+h;
if (m<=17) return "quarter past "+h;
if (m<=23) return "twenty past "+h;
if (m<=28) return "twenty-five past "+h;
if (m<=33) return "half past "+h;
if (m<=38) return "twenty-five to "+h;
if (m<=43) return "twenty to "+h;
if (m<=48) return "quarter to "+h;
if (m<=53) return "ten to "+h;
if (m<=58) return "five to "+h;
return "h:m"; // never reached?
}
function daytime(h) {
if (!h || h>21) return " at night"
if (h<12) return " in the morning";
if (h<=17) return " in the afternoon";
return " in the evening"; // default
}
function ish(h,m) {
if (!h && !m) { // if no time supplied, use the system time
time = new Date()
h = time.getHours()
m = time.getMinutes()
}
z = daytime(h);
h = h % 12 // fix to 12 hour clock
if (m>57 && time.getSeconds()>30) m++; // round seconds
if (m>60) m=0 // round up minutes
if (m>33) h++ // round up hours
if (h>12) h = 1 // the clock turns round..
if (h==0) h = 12
return "It's now about "+ishtime(h,m)+z+"."
}
document.writeln(ish().fontcolor("black"),"<P>")

</script>

=====================================================
 
D

Don Schmidt

Finally had some time to give the three scripts a try; the first two failed
to show anything on the website, glitch in the script?

The third with "It's approximately" leaves a queasy feeling to this ol
engineer. <G>

Don


Spike said:
Don

Here are three scripts that you might want for your test page

No extra codes needed one of them needs countdown.js in web page folder

Have fun

Spike

=====================================================
<script language="JavaScript">
TargetDate = new Date();
BackColor = "transparent";
ForeColor = "navy";
CountActive = true;
CountStepper = 1;
LeadingZero = true;
DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds.";
FinishMessage = "It is finally here!";
</script>
<script language="JavaScript" src="countdown.js"></script>

=====================================================
=====================================================

<SCRIPT Language="JavaScript">

<!--
// Week of the year script - By Ada Shimar ([email protected])
// Based on code by Duncan Kabinu, Florida Department of Agriculture.
// Modified by Italian anonimous on 19.08.2002
// Visit JavaScript Kit (http://javascriptkit.com) for this script and
400+ more

function weekNo() {
var totalDays = 0;
now = new Date();
years=now.getYear();
var days = new Array(12); // Array to hold the total days in a month
days[0] = 31;
days[2] = 31;
days[3] = 30;
days[4] = 31;
days[5] = 30;
days[6] = 31;
days[7] = 31;
days[8] = 30;
days[9] = 31;
days[10] = 30;
days[11] = 31;

// Check to see if this is a leap year
if (Math.round(now.getYear()/4) == now.getYear()/4) {
days[1] = 29
}else{
days[1] = 28
}

// If this is January no need for any fancy calculation otherwise figure
out the
// total number of days to date and then determine what week
if (now.getMonth() == 0) {
totalDays = totalDays + now.getDate();
}else{
var curMonth = now.getMonth();
for (var count = 1; count <= curMonth; count++) {
totalDays = totalDays + days[count - 1];
}
totalDays = totalDays + now.getDate();
}
// Here is the modification: considering when start the 1st week of year.
// Originally was only: var week = Math.round(totalDays/7)
// Check if browser is "Microsoft Internet Explorer" or not and apply the
right var
var agt=navigator.userAgent.toLowerCase();
if ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)) {
var firstday=new Date("01/01/"+String(now.getYear())).getDay();
}
else {
var firstday=new Date("01/01/"+String(1900+now.getYear())).getDay();
}
var diff=7-firstday+1;
var week = Math.round((totalDays+diff-firstday)/7); return week;
}

document.write("Welcome to <b>week "+weekNo()+"<\/b> of "+years+"!")
// -->
</SCRIPT>

=====================================================
=====================================================

<script language="JavaScript">

/*
Plain English Time
By Adam Brown ([email protected])
For this script and more,
Visit http://javascriptkit.com
*/

function number(x) {
if (x==1) return "one"; if (x==2) return "two"; if (x==3) return "three";
if (x==4) return "four"; if (x==5) return "five"; if (x==6) return "six";
if (x==7) return "seven"; if (x==8) return "eight"; if (x==9) return
"nine";
if (x==10) return "ten"; if (x==11) return "eleven"; if (x==12) return
"twelve";
return x; //default
}
function ishtime(h,m) {
h = number(h)
if (m<=3 || m>57) return h+" o'clock";
if (m<=7) return "five past "+h;
if (m<=12) return "ten past "+h;
if (m<=17) return "quarter past "+h;
if (m<=23) return "twenty past "+h;
if (m<=28) return "twenty-five past "+h;
if (m<=33) return "half past "+h;
if (m<=38) return "twenty-five to "+h;
if (m<=43) return "twenty to "+h;
if (m<=48) return "quarter to "+h;
if (m<=53) return "ten to "+h;
if (m<=58) return "five to "+h;
return "h:m"; // never reached?
}
function daytime(h) {
if (!h || h>21) return " at night"
if (h<12) return " in the morning";
if (h<=17) return " in the afternoon";
return " in the evening"; // default
}
function ish(h,m) {
if (!h && !m) { // if no time supplied, use the system time
time = new Date()
h = time.getHours()
m = time.getMinutes()
}
z = daytime(h);
h = h % 12 // fix to 12 hour clock
if (m>57 && time.getSeconds()>30) m++; // round seconds
if (m>60) m=0 // round up minutes
if (m>33) h++ // round up hours
if (h>12) h = 1 // the clock turns round..
if (h==0) h = 12
return "It's now about "+ishtime(h,m)+z+"."
}
document.writeln(ish().fontcolor("black"),"<P>")

</script>

=====================================================
 
S

Spike

The approximate time looks good on your test site (probably drives folks
nuts with approximate time)

I am wondering if pub 2000 does not like the script
All three work OK using 2007

The first one shows how long you are on the web site (requires countdown.js)

The second one tells you what week it is ( 1 thru 52 )

It's not an exact science

Spike

Don Schmidt said:
Finally had some time to give the three scripts a try; the first two
failed to show anything on the website, glitch in the script?

The third with "It's approximately" leaves a queasy feeling to this ol
engineer. <G>

Don


Spike said:
Don

Here are three scripts that you might want for your test page

No extra codes needed one of them needs countdown.js in web page folder

Have fun

Spike

=====================================================
<script language="JavaScript">
TargetDate = new Date();
BackColor = "transparent";
ForeColor = "navy";
CountActive = true;
CountStepper = 1;
LeadingZero = true;
DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds.";
FinishMessage = "It is finally here!";
</script>
<script language="JavaScript" src="countdown.js"></script>

=====================================================
=====================================================

<SCRIPT Language="JavaScript">

<!--
// Week of the year script - By Ada Shimar ([email protected])
// Based on code by Duncan Kabinu, Florida Department of Agriculture.
// Modified by Italian anonimous on 19.08.2002
// Visit JavaScript Kit (http://javascriptkit.com) for this script and
400+ more

function weekNo() {
var totalDays = 0;
now = new Date();
years=now.getYear();
var days = new Array(12); // Array to hold the total days in a month
days[0] = 31;
days[2] = 31;
days[3] = 30;
days[4] = 31;
days[5] = 30;
days[6] = 31;
days[7] = 31;
days[8] = 30;
days[9] = 31;
days[10] = 30;
days[11] = 31;

// Check to see if this is a leap year
if (Math.round(now.getYear()/4) == now.getYear()/4) {
days[1] = 29
}else{
days[1] = 28
}

// If this is January no need for any fancy calculation otherwise figure
out the
// total number of days to date and then determine what week
if (now.getMonth() == 0) {
totalDays = totalDays + now.getDate();
}else{
var curMonth = now.getMonth();
for (var count = 1; count <= curMonth; count++) {
totalDays = totalDays + days[count - 1];
}
totalDays = totalDays + now.getDate();
}
// Here is the modification: considering when start the 1st week of year.
// Originally was only: var week = Math.round(totalDays/7)
// Check if browser is "Microsoft Internet Explorer" or not and apply the
right var
var agt=navigator.userAgent.toLowerCase();
if ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)) {
var firstday=new Date("01/01/"+String(now.getYear())).getDay();
}
else {
var firstday=new Date("01/01/"+String(1900+now.getYear())).getDay();
}
var diff=7-firstday+1;
var week = Math.round((totalDays+diff-firstday)/7); return week;
}

document.write("Welcome to <b>week "+weekNo()+"<\/b> of "+years+"!")
// -->
</SCRIPT>

=====================================================
=====================================================

<script language="JavaScript">

/*
Plain English Time
By Adam Brown ([email protected])
For this script and more,
Visit http://javascriptkit.com
*/

function number(x) {
if (x==1) return "one"; if (x==2) return "two"; if (x==3) return "three";
if (x==4) return "four"; if (x==5) return "five"; if (x==6) return "six";
if (x==7) return "seven"; if (x==8) return "eight"; if (x==9) return
"nine";
if (x==10) return "ten"; if (x==11) return "eleven"; if (x==12) return
"twelve";
return x; //default
}
function ishtime(h,m) {
h = number(h)
if (m<=3 || m>57) return h+" o'clock";
if (m<=7) return "five past "+h;
if (m<=12) return "ten past "+h;
if (m<=17) return "quarter past "+h;
if (m<=23) return "twenty past "+h;
if (m<=28) return "twenty-five past "+h;
if (m<=33) return "half past "+h;
if (m<=38) return "twenty-five to "+h;
if (m<=43) return "twenty to "+h;
if (m<=48) return "quarter to "+h;
if (m<=53) return "ten to "+h;
if (m<=58) return "five to "+h;
return "h:m"; // never reached?
}
function daytime(h) {
if (!h || h>21) return " at night"
if (h<12) return " in the morning";
if (h<=17) return " in the afternoon";
return " in the evening"; // default
}
function ish(h,m) {
if (!h && !m) { // if no time supplied, use the system time
time = new Date()
h = time.getHours()
m = time.getMinutes()
}
z = daytime(h);
h = h % 12 // fix to 12 hour clock
if (m>57 && time.getSeconds()>30) m++; // round seconds
if (m>60) m=0 // round up minutes
if (m>33) h++ // round up hours
if (h>12) h = 1 // the clock turns round..
if (h==0) h = 12
return "It's now about "+ishtime(h,m)+z+"."
}
document.writeln(ish().fontcolor("black"),"<P>")

</script>

=====================================================
 
S

Spike

Don
http://geocities.com/spikestestpage/

The three scripts in action

Spike

Don Schmidt said:
Finally had some time to give the three scripts a try; the first two
failed to show anything on the website, glitch in the script?

The third with "It's approximately" leaves a queasy feeling to this ol
engineer. <G>

Don


Spike said:
Don

Here are three scripts that you might want for your test page

No extra codes needed one of them needs countdown.js in web page folder

Have fun

Spike

=====================================================
<script language="JavaScript">
TargetDate = new Date();
BackColor = "transparent";
ForeColor = "navy";
CountActive = true;
CountStepper = 1;
LeadingZero = true;
DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds.";
FinishMessage = "It is finally here!";
</script>
<script language="JavaScript" src="countdown.js"></script>

=====================================================
=====================================================

<SCRIPT Language="JavaScript">

<!--
// Week of the year script - By Ada Shimar ([email protected])
// Based on code by Duncan Kabinu, Florida Department of Agriculture.
// Modified by Italian anonimous on 19.08.2002
// Visit JavaScript Kit (http://javascriptkit.com) for this script and
400+ more

function weekNo() {
var totalDays = 0;
now = new Date();
years=now.getYear();
var days = new Array(12); // Array to hold the total days in a month
days[0] = 31;
days[2] = 31;
days[3] = 30;
days[4] = 31;
days[5] = 30;
days[6] = 31;
days[7] = 31;
days[8] = 30;
days[9] = 31;
days[10] = 30;
days[11] = 31;

// Check to see if this is a leap year
if (Math.round(now.getYear()/4) == now.getYear()/4) {
days[1] = 29
}else{
days[1] = 28
}

// If this is January no need for any fancy calculation otherwise figure
out the
// total number of days to date and then determine what week
if (now.getMonth() == 0) {
totalDays = totalDays + now.getDate();
}else{
var curMonth = now.getMonth();
for (var count = 1; count <= curMonth; count++) {
totalDays = totalDays + days[count - 1];
}
totalDays = totalDays + now.getDate();
}
// Here is the modification: considering when start the 1st week of year.
// Originally was only: var week = Math.round(totalDays/7)
// Check if browser is "Microsoft Internet Explorer" or not and apply the
right var
var agt=navigator.userAgent.toLowerCase();
if ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)) {
var firstday=new Date("01/01/"+String(now.getYear())).getDay();
}
else {
var firstday=new Date("01/01/"+String(1900+now.getYear())).getDay();
}
var diff=7-firstday+1;
var week = Math.round((totalDays+diff-firstday)/7); return week;
}

document.write("Welcome to <b>week "+weekNo()+"<\/b> of "+years+"!")
// -->
</SCRIPT>

=====================================================
=====================================================

<script language="JavaScript">

/*
Plain English Time
By Adam Brown ([email protected])
For this script and more,
Visit http://javascriptkit.com
*/

function number(x) {
if (x==1) return "one"; if (x==2) return "two"; if (x==3) return "three";
if (x==4) return "four"; if (x==5) return "five"; if (x==6) return "six";
if (x==7) return "seven"; if (x==8) return "eight"; if (x==9) return
"nine";
if (x==10) return "ten"; if (x==11) return "eleven"; if (x==12) return
"twelve";
return x; //default
}
function ishtime(h,m) {
h = number(h)
if (m<=3 || m>57) return h+" o'clock";
if (m<=7) return "five past "+h;
if (m<=12) return "ten past "+h;
if (m<=17) return "quarter past "+h;
if (m<=23) return "twenty past "+h;
if (m<=28) return "twenty-five past "+h;
if (m<=33) return "half past "+h;
if (m<=38) return "twenty-five to "+h;
if (m<=43) return "twenty to "+h;
if (m<=48) return "quarter to "+h;
if (m<=53) return "ten to "+h;
if (m<=58) return "five to "+h;
return "h:m"; // never reached?
}
function daytime(h) {
if (!h || h>21) return " at night"
if (h<12) return " in the morning";
if (h<=17) return " in the afternoon";
return " in the evening"; // default
}
function ish(h,m) {
if (!h && !m) { // if no time supplied, use the system time
time = new Date()
h = time.getHours()
m = time.getMinutes()
}
z = daytime(h);
h = h % 12 // fix to 12 hour clock
if (m>57 && time.getSeconds()>30) m++; // round seconds
if (m>60) m=0 // round up minutes
if (m>33) h++ // round up hours
if (h>12) h = 1 // the clock turns round..
if (h==0) h = 12
return "It's now about "+ishtime(h,m)+z+"."
}
document.writeln(ish().fontcolor("black"),"<P>")

</script>

=====================================================
 
D

Don Schmidt

The site address returns,

"Sorry, unused."

don


Spike said:
Don
http://geocities.com/spikestestpage/

The three scripts in action

Spike

Don Schmidt said:
Finally had some time to give the three scripts a try; the first two
failed to show anything on the website, glitch in the script?

The third with "It's approximately" leaves a queasy feeling to this ol
engineer. <G>

Don


Spike said:
Don

Here are three scripts that you might want for your test page

No extra codes needed one of them needs countdown.js in web page
folder

Have fun

Spike

=====================================================
<script language="JavaScript">
TargetDate = new Date();
BackColor = "transparent";
ForeColor = "navy";
CountActive = true;
CountStepper = 1;
LeadingZero = true;
DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%%
Seconds.";
FinishMessage = "It is finally here!";
</script>
<script language="JavaScript" src="countdown.js"></script>

=====================================================
=====================================================

<SCRIPT Language="JavaScript">

<!--
// Week of the year script - By Ada Shimar ([email protected])
// Based on code by Duncan Kabinu, Florida Department of Agriculture.
// Modified by Italian anonimous on 19.08.2002
// Visit JavaScript Kit (http://javascriptkit.com) for this script and
400+ more

function weekNo() {
var totalDays = 0;
now = new Date();
years=now.getYear();
var days = new Array(12); // Array to hold the total days in a month
days[0] = 31;
days[2] = 31;
days[3] = 30;
days[4] = 31;
days[5] = 30;
days[6] = 31;
days[7] = 31;
days[8] = 30;
days[9] = 31;
days[10] = 30;
days[11] = 31;

// Check to see if this is a leap year
if (Math.round(now.getYear()/4) == now.getYear()/4) {
days[1] = 29
}else{
days[1] = 28
}

// If this is January no need for any fancy calculation otherwise figure
out the
// total number of days to date and then determine what week
if (now.getMonth() == 0) {
totalDays = totalDays + now.getDate();
}else{
var curMonth = now.getMonth();
for (var count = 1; count <= curMonth; count++) {
totalDays = totalDays + days[count - 1];
}
totalDays = totalDays + now.getDate();
}
// Here is the modification: considering when start the 1st week of
year.
// Originally was only: var week = Math.round(totalDays/7)
// Check if browser is "Microsoft Internet Explorer" or not and apply
the right var
var agt=navigator.userAgent.toLowerCase();
if ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)) {
var firstday=new Date("01/01/"+String(now.getYear())).getDay();
}
else {
var firstday=new Date("01/01/"+String(1900+now.getYear())).getDay();
}
var diff=7-firstday+1;
var week = Math.round((totalDays+diff-firstday)/7); return week;
}

document.write("Welcome to <b>week "+weekNo()+"<\/b> of "+years+"!")
// -->
</SCRIPT>

=====================================================
=====================================================

<script language="JavaScript">

/*
Plain English Time
By Adam Brown ([email protected])
For this script and more,
Visit http://javascriptkit.com
*/

function number(x) {
if (x==1) return "one"; if (x==2) return "two"; if (x==3) return
"three";
if (x==4) return "four"; if (x==5) return "five"; if (x==6) return
"six";
if (x==7) return "seven"; if (x==8) return "eight"; if (x==9) return
"nine";
if (x==10) return "ten"; if (x==11) return "eleven"; if (x==12) return
"twelve";
return x; //default
}
function ishtime(h,m) {
h = number(h)
if (m<=3 || m>57) return h+" o'clock";
if (m<=7) return "five past "+h;
if (m<=12) return "ten past "+h;
if (m<=17) return "quarter past "+h;
if (m<=23) return "twenty past "+h;
if (m<=28) return "twenty-five past "+h;
if (m<=33) return "half past "+h;
if (m<=38) return "twenty-five to "+h;
if (m<=43) return "twenty to "+h;
if (m<=48) return "quarter to "+h;
if (m<=53) return "ten to "+h;
if (m<=58) return "five to "+h;
return "h:m"; // never reached?
}
function daytime(h) {
if (!h || h>21) return " at night"
if (h<12) return " in the morning";
if (h<=17) return " in the afternoon";
return " in the evening"; // default
}
function ish(h,m) {
if (!h && !m) { // if no time supplied, use the system time
time = new Date()
h = time.getHours()
m = time.getMinutes()
}
z = daytime(h);
h = h % 12 // fix to 12 hour clock
if (m>57 && time.getSeconds()>30) m++; // round seconds
if (m>60) m=0 // round up minutes
if (m>33) h++ // round up hours
if (h>12) h = 1 // the clock turns round..
if (h==0) h = 12
return "It's now about "+ishtime(h,m)+z+"."
}
document.writeln(ish().fontcolor("black"),"<P>")

</script>

=====================================================
 
S

Spike

Don
Yes I see that
Thanks for posting that

Trying to get that resolved (it worked for a while)
It is a free service and they do not allow redirects or reference links out
of their system. WELL!! The scripts had links in the comments section
referencing the script author. There are no visible or invisible links on
the web page to click on. I assume that geocities web crawler saw those and
locked it out. I put spaces in the links to see if that will do the trick
and I am waiting for a reply from them. Oh well what can you expect for a
FREE service. Geocities comes with yahoo e-mail account. This has nothing
to do directly with Publisher 2000 .2 ,3 ,7 but it may be of interest to
the readers. If I get it resolved I will post back.

Spike

Don Schmidt said:
The site address returns,

"Sorry, unused."

don


Spike said:
Don
http://geocities.com/spikestestpage/

The three scripts in action

Spike

Don Schmidt said:
Finally had some time to give the three scripts a try; the first two
failed to show anything on the website, glitch in the script?

The third with "It's approximately" leaves a queasy feeling to this ol
engineer. <G>

Don


Don

Here are three scripts that you might want for your test page

No extra codes needed one of them needs countdown.js in web page
folder

Have fun

Spike

=====================================================
<script language="JavaScript">
TargetDate = new Date();
BackColor = "transparent";
ForeColor = "navy";
CountActive = true;
CountStepper = 1;
LeadingZero = true;
DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%%
Seconds.";
FinishMessage = "It is finally here!";
</script>
<script language="JavaScript" src="countdown.js"></script>

=====================================================
=====================================================

<SCRIPT Language="JavaScript">

<!--
// Week of the year script - By Ada Shimar ([email protected])
// Based on code by Duncan Kabinu, Florida Department of Agriculture.
// Modified by Italian anonimous on 19.08.2002
// Visit JavaScript Kit (http://javascriptkit.com) for this script and
400+ more

function weekNo() {
var totalDays = 0;
now = new Date();
years=now.getYear();
var days = new Array(12); // Array to hold the total days in a month
days[0] = 31;
days[2] = 31;
days[3] = 30;
days[4] = 31;
days[5] = 30;
days[6] = 31;
days[7] = 31;
days[8] = 30;
days[9] = 31;
days[10] = 30;
days[11] = 31;

// Check to see if this is a leap year
if (Math.round(now.getYear()/4) == now.getYear()/4) {
days[1] = 29
}else{
days[1] = 28
}

// If this is January no need for any fancy calculation otherwise
figure out the
// total number of days to date and then determine what week
if (now.getMonth() == 0) {
totalDays = totalDays + now.getDate();
}else{
var curMonth = now.getMonth();
for (var count = 1; count <= curMonth; count++) {
totalDays = totalDays + days[count - 1];
}
totalDays = totalDays + now.getDate();
}
// Here is the modification: considering when start the 1st week of
year.
// Originally was only: var week = Math.round(totalDays/7)
// Check if browser is "Microsoft Internet Explorer" or not and apply
the right var
var agt=navigator.userAgent.toLowerCase();
if ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)) {
var firstday=new Date("01/01/"+String(now.getYear())).getDay();
}
else {
var firstday=new Date("01/01/"+String(1900+now.getYear())).getDay();
}
var diff=7-firstday+1;
var week = Math.round((totalDays+diff-firstday)/7); return week;
}

document.write("Welcome to <b>week "+weekNo()+"<\/b> of "+years+"!")
// -->
</SCRIPT>

=====================================================
=====================================================

<script language="JavaScript">

/*
Plain English Time
By Adam Brown ([email protected])
For this script and more,
Visit http://javascriptkit.com
*/

function number(x) {
if (x==1) return "one"; if (x==2) return "two"; if (x==3) return
"three";
if (x==4) return "four"; if (x==5) return "five"; if (x==6) return
"six";
if (x==7) return "seven"; if (x==8) return "eight"; if (x==9) return
"nine";
if (x==10) return "ten"; if (x==11) return "eleven"; if (x==12) return
"twelve";
return x; //default
}
function ishtime(h,m) {
h = number(h)
if (m<=3 || m>57) return h+" o'clock";
if (m<=7) return "five past "+h;
if (m<=12) return "ten past "+h;
if (m<=17) return "quarter past "+h;
if (m<=23) return "twenty past "+h;
if (m<=28) return "twenty-five past "+h;
if (m<=33) return "half past "+h;
if (m<=38) return "twenty-five to "+h;
if (m<=43) return "twenty to "+h;
if (m<=48) return "quarter to "+h;
if (m<=53) return "ten to "+h;
if (m<=58) return "five to "+h;
return "h:m"; // never reached?
}
function daytime(h) {
if (!h || h>21) return " at night"
if (h<12) return " in the morning";
if (h<=17) return " in the afternoon";
return " in the evening"; // default
}
function ish(h,m) {
if (!h && !m) { // if no time supplied, use the system time
time = new Date()
h = time.getHours()
m = time.getMinutes()
}
z = daytime(h);
h = h % 12 // fix to 12 hour clock
if (m>57 && time.getSeconds()>30) m++; // round seconds
if (m>60) m=0 // round up minutes
if (m>33) h++ // round up hours
if (h>12) h = 1 // the clock turns round..
if (h==0) h = 12
return "It's now about "+ishtime(h,m)+z+"."
}
document.writeln(ish().fontcolor("black"),"<P>")

</script>

=====================================================
 
D

Don Schmidt

I'll be watching for it.

Here is the script I really like; would change the text to Italian on my
Goomba website. It is very good except the time is static once the page is
opened. 'Been doing some guess and by-gosh tinkering trying to get a dynamic
clock to work but lack the know how here.

<p style="color:#000000"><font size= 2 face= verdana>

<SCRIPT LANGUAGE="JavaScript">
<!--
d = new Date();
dateText = "";
dayValue = d.getDay();
if (dayValue == 0)
dateText += "Sunday";
else if (dayValue == 1)
dateText += "Monday";
else if (dayValue == 2)
dateText += "Tuesday";
else if (dayValue == 3)
dateText += "Wednesday";
else if (dayValue == 4)
dateText += "Thursday";
else if (dayValue == 5)
dateText += "Friday";
else if (dayValue == 6)
dateText += "Saturday";

monthValue = d.getMonth();
dateText += " "
if (monthValue == 0)
dateText += "January";
if (monthValue == 1)
dateText += "February";
if (monthValue == 2)
dateText += "March";
if (monthValue == 3)
dateText += "April";
if (monthValue == 4)
dateText += "May";
if (monthValue == 5)
dateText += "June";
if (monthValue == 6)
dateText += "July";
if (monthValue == 7)
dateText += "August";
if (monthValue == 8)
dateText += "September";
if (monthValue == 9)
dateText += "October";
if (monthValue == 10)
dateText += "November";
if (monthValue == 11)
dateText += "December";

if (navigator.appName.indexOf('Microsoft') != -1)
dateText += " " + d.getDate() + ", " + (0000 + d.getYear());
else if (navigator.appName.indexOf('Netscape') != -1)
dateText += " " + d.getDate() + ", " + (1900 + d.getYear());

minuteValue = d.getMinutes();
if (minuteValue < 10)
minuteValue = "0" + minuteValue

hourValue = d.getHours();
if (hourValue < 12)
{
greeting = "Good morning!";
timeText = " at " + hourValue + ":" + minuteValue +
" AM. Welcome to our site.";
}
else if (hourValue == 12)
{
greeting = "Good afternoon!";
timeText = " at " + hourValue + ":" + minuteValue +
" PM. Welcome to our site.";
}
else if (hourValue < 17)
{
greeting = "Good afternoon!";
timeText = " at " + (hourValue-12) + ":" + minuteValue +
" PM. Welcome to our site.";
}
else
{
greeting = "Good evening!";
timeText = " at " + (hourValue-12) + ":" + minuteValue +
" PM. Welcome to our site.";
}
document.open();
document.write(greeting + " It's " + dateText + timeText);
// -->
</SCRIPT>

Ciao,

Don






Spike said:
Don
Yes I see that
Thanks for posting that

Trying to get that resolved (it worked for a while)
It is a free service and they do not allow redirects or reference links
out of their system. WELL!! The scripts had links in the comments
section referencing the script author. There are no visible or invisible
links on the web page to click on. I assume that geocities web crawler
saw those and locked it out. I put spaces in the links to see if that
will do the trick and I am waiting for a reply from them. Oh well what
can you expect for a FREE service. Geocities comes with yahoo e-mail
account. This has nothing to do directly with Publisher 2000 .2 ,3 ,7
but it may be of interest to the readers. If I get it resolved I will
post back.

Spike

Don Schmidt said:
The site address returns,

"Sorry, unused."

don


Spike said:
Don
http://geocities.com/spikestestpage/

The three scripts in action

Spike

Finally had some time to give the three scripts a try; the first two
failed to show anything on the website, glitch in the script?

The third with "It's approximately" leaves a queasy feeling to this ol
engineer. <G>

Don


Don

Here are three scripts that you might want for your test page

No extra codes needed one of them needs countdown.js in web page
folder

Have fun

Spike

=====================================================
<script language="JavaScript">
TargetDate = new Date();
BackColor = "transparent";
ForeColor = "navy";
CountActive = true;
CountStepper = 1;
LeadingZero = true;
DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%%
Seconds.";
FinishMessage = "It is finally here!";
</script>
<script language="JavaScript" src="countdown.js"></script>

=====================================================
=====================================================

<SCRIPT Language="JavaScript">

<!--
// Week of the year script - By Ada Shimar ([email protected])
// Based on code by Duncan Kabinu, Florida Department of Agriculture.
// Modified by Italian anonimous on 19.08.2002
// Visit JavaScript Kit (http://javascriptkit.com) for this script and
400+ more

function weekNo() {
var totalDays = 0;
now = new Date();
years=now.getYear();
var days = new Array(12); // Array to hold the total days in a month
days[0] = 31;
days[2] = 31;
days[3] = 30;
days[4] = 31;
days[5] = 30;
days[6] = 31;
days[7] = 31;
days[8] = 30;
days[9] = 31;
days[10] = 30;
days[11] = 31;

// Check to see if this is a leap year
if (Math.round(now.getYear()/4) == now.getYear()/4) {
days[1] = 29
}else{
days[1] = 28
}

// If this is January no need for any fancy calculation otherwise
figure out the
// total number of days to date and then determine what week
if (now.getMonth() == 0) {
totalDays = totalDays + now.getDate();
}else{
var curMonth = now.getMonth();
for (var count = 1; count <= curMonth; count++) {
totalDays = totalDays + days[count - 1];
}
totalDays = totalDays + now.getDate();
}
// Here is the modification: considering when start the 1st week of
year.
// Originally was only: var week = Math.round(totalDays/7)
// Check if browser is "Microsoft Internet Explorer" or not and apply
the right var
var agt=navigator.userAgent.toLowerCase();
if ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)) {
var firstday=new Date("01/01/"+String(now.getYear())).getDay();
}
else {
var firstday=new Date("01/01/"+String(1900+now.getYear())).getDay();
}
var diff=7-firstday+1;
var week = Math.round((totalDays+diff-firstday)/7); return week;
}

document.write("Welcome to <b>week "+weekNo()+"<\/b> of "+years+"!")
// -->
</SCRIPT>

=====================================================
=====================================================

<script language="JavaScript">

/*
Plain English Time
By Adam Brown ([email protected])
For this script and more,
Visit http://javascriptkit.com
*/

function number(x) {
if (x==1) return "one"; if (x==2) return "two"; if (x==3) return
"three";
if (x==4) return "four"; if (x==5) return "five"; if (x==6) return
"six";
if (x==7) return "seven"; if (x==8) return "eight"; if (x==9) return
"nine";
if (x==10) return "ten"; if (x==11) return "eleven"; if (x==12) return
"twelve";
return x; //default
}
function ishtime(h,m) {
h = number(h)
if (m<=3 || m>57) return h+" o'clock";
if (m<=7) return "five past "+h;
if (m<=12) return "ten past "+h;
if (m<=17) return "quarter past "+h;
if (m<=23) return "twenty past "+h;
if (m<=28) return "twenty-five past "+h;
if (m<=33) return "half past "+h;
if (m<=38) return "twenty-five to "+h;
if (m<=43) return "twenty to "+h;
if (m<=48) return "quarter to "+h;
if (m<=53) return "ten to "+h;
if (m<=58) return "five to "+h;
return "h:m"; // never reached?
}
function daytime(h) {
if (!h || h>21) return " at night"
if (h<12) return " in the morning";
if (h<=17) return " in the afternoon";
return " in the evening"; // default
}
function ish(h,m) {
if (!h && !m) { // if no time supplied, use the system time
time = new Date()
h = time.getHours()
m = time.getMinutes()
}
z = daytime(h);
h = h % 12 // fix to 12 hour clock
if (m>57 && time.getSeconds()>30) m++; // round seconds
if (m>60) m=0 // round up minutes
if (m>33) h++ // round up hours
if (h>12) h = 1 // the clock turns round..
if (h==0) h = 12
return "It's now about "+ishtime(h,m)+z+"."
}
document.writeln(ish().fontcolor("black"),"<P>")

</script>

=====================================================
 
S

Spike

Don

It's back up and hopefully they will leave it up. Look Quick :) One of
the scripts contained the web address of the author so I modified it to read

www dot mydomain dot com from www.mydomain.com

I looked at your script and modified it for my test page
I put a continues clock on the page that you might look at

If geocities locks me out again I have an alternate plan
I will set up a sub domain on my own space with a unique domain name
..info names are going for 99 cents a month on my provider

Spike


Don Schmidt said:
I'll be watching for it.

Here is the script I really like; would change the text to Italian on my
Goomba website. It is very good except the time is static once the page
is opened. 'Been doing some guess and by-gosh tinkering trying to get a
dynamic clock to work but lack the know how here.

<p style="color:#000000"><font size= 2 face= verdana>

<SCRIPT LANGUAGE="JavaScript">
<!--
d = new Date();
dateText = "";
dayValue = d.getDay();
if (dayValue == 0)
dateText += "Sunday";
else if (dayValue == 1)
dateText += "Monday";
else if (dayValue == 2)
dateText += "Tuesday";
else if (dayValue == 3)
dateText += "Wednesday";
else if (dayValue == 4)
dateText += "Thursday";
else if (dayValue == 5)
dateText += "Friday";
else if (dayValue == 6)
dateText += "Saturday";

monthValue = d.getMonth();
dateText += " "
if (monthValue == 0)
dateText += "January";
if (monthValue == 1)
dateText += "February";
if (monthValue == 2)
dateText += "March";
if (monthValue == 3)
dateText += "April";
if (monthValue == 4)
dateText += "May";
if (monthValue == 5)
dateText += "June";
if (monthValue == 6)
dateText += "July";
if (monthValue == 7)
dateText += "August";
if (monthValue == 8)
dateText += "September";
if (monthValue == 9)
dateText += "October";
if (monthValue == 10)
dateText += "November";
if (monthValue == 11)
dateText += "December";

if (navigator.appName.indexOf('Microsoft') != -1)
dateText += " " + d.getDate() + ", " + (0000 + d.getYear());
else if (navigator.appName.indexOf('Netscape') != -1)
dateText += " " + d.getDate() + ", " + (1900 + d.getYear());

minuteValue = d.getMinutes();
if (minuteValue < 10)
minuteValue = "0" + minuteValue

hourValue = d.getHours();
if (hourValue < 12)
{
greeting = "Good morning!";
timeText = " at " + hourValue + ":" + minuteValue +
" AM. Welcome to our site.";
}
else if (hourValue == 12)
{
greeting = "Good afternoon!";
timeText = " at " + hourValue + ":" + minuteValue +
" PM. Welcome to our site.";
}
else if (hourValue < 17)
{
greeting = "Good afternoon!";
timeText = " at " + (hourValue-12) + ":" + minuteValue +
" PM. Welcome to our site.";
}
else
{
greeting = "Good evening!";
timeText = " at " + (hourValue-12) + ":" + minuteValue +
" PM. Welcome to our site.";
}
document.open();
document.write(greeting + " It's " + dateText + timeText);
// -->
</SCRIPT>

Ciao,

Don






Spike said:
Don
Yes I see that
Thanks for posting that

Trying to get that resolved (it worked for a while)
It is a free service and they do not allow redirects or reference links
out of their system. WELL!! The scripts had links in the comments
section referencing the script author. There are no visible or invisible
links on the web page to click on. I assume that geocities web crawler
saw those and locked it out. I put spaces in the links to see if that
will do the trick and I am waiting for a reply from them. Oh well what
can you expect for a FREE service. Geocities comes with yahoo e-mail
account. This has nothing to do directly with Publisher 2000 .2 ,3 ,7
but it may be of interest to the readers. If I get it resolved I will
post back.

Spike

Don Schmidt said:
The site address returns,

"Sorry, unused."

don


Don
http://geocities.com/spikestestpage/

The three scripts in action

Spike

Finally had some time to give the three scripts a try; the first two
failed to show anything on the website, glitch in the script?

The third with "It's approximately" leaves a queasy feeling to this ol
engineer. <G>

Don


Don

Here are three scripts that you might want for your test page

No extra codes needed one of them needs countdown.js in web page
folder

Have fun

Spike

=====================================================
<script language="JavaScript">
TargetDate = new Date();
BackColor = "transparent";
ForeColor = "navy";
CountActive = true;
CountStepper = 1;
LeadingZero = true;
DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%%
Seconds.";
FinishMessage = "It is finally here!";
</script>
<script language="JavaScript" src="countdown.js"></script>

=====================================================
=====================================================

<SCRIPT Language="JavaScript">

<!--
// Week of the year script - By Ada Shimar ([email protected])
// Based on code by Duncan Kabinu, Florida Department of Agriculture.
// Modified by Italian anonimous on 19.08.2002
// Visit JavaScript Kit (http://javascriptkit.com) for this script
and 400+ more

function weekNo() {
var totalDays = 0;
now = new Date();
years=now.getYear();
var days = new Array(12); // Array to hold the total days in a month
days[0] = 31;
days[2] = 31;
days[3] = 30;
days[4] = 31;
days[5] = 30;
days[6] = 31;
days[7] = 31;
days[8] = 30;
days[9] = 31;
days[10] = 30;
days[11] = 31;

// Check to see if this is a leap year
if (Math.round(now.getYear()/4) == now.getYear()/4) {
days[1] = 29
}else{
days[1] = 28
}

// If this is January no need for any fancy calculation otherwise
figure out the
// total number of days to date and then determine what week
if (now.getMonth() == 0) {
totalDays = totalDays + now.getDate();
}else{
var curMonth = now.getMonth();
for (var count = 1; count <= curMonth; count++) {
totalDays = totalDays + days[count - 1];
}
totalDays = totalDays + now.getDate();
}
// Here is the modification: considering when start the 1st week of
year.
// Originally was only: var week = Math.round(totalDays/7)
// Check if browser is "Microsoft Internet Explorer" or not and apply
the right var
var agt=navigator.userAgent.toLowerCase();
if ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)) {
var firstday=new Date("01/01/"+String(now.getYear())).getDay();
}
else {
var firstday=new Date("01/01/"+String(1900+now.getYear())).getDay();
}
var diff=7-firstday+1;
var week = Math.round((totalDays+diff-firstday)/7); return week;
}

document.write("Welcome to <b>week "+weekNo()+"<\/b> of "+years+"!")
// -->
</SCRIPT>

=====================================================
=====================================================

<script language="JavaScript">

/*
Plain English Time
By Adam Brown ([email protected])
For this script and more,
Visit http://javascriptkit.com
*/

function number(x) {
if (x==1) return "one"; if (x==2) return "two"; if (x==3) return
"three";
if (x==4) return "four"; if (x==5) return "five"; if (x==6) return
"six";
if (x==7) return "seven"; if (x==8) return "eight"; if (x==9) return
"nine";
if (x==10) return "ten"; if (x==11) return "eleven"; if (x==12)
return "twelve";
return x; //default
}
function ishtime(h,m) {
h = number(h)
if (m<=3 || m>57) return h+" o'clock";
if (m<=7) return "five past "+h;
if (m<=12) return "ten past "+h;
if (m<=17) return "quarter past "+h;
if (m<=23) return "twenty past "+h;
if (m<=28) return "twenty-five past "+h;
if (m<=33) return "half past "+h;
if (m<=38) return "twenty-five to "+h;
if (m<=43) return "twenty to "+h;
if (m<=48) return "quarter to "+h;
if (m<=53) return "ten to "+h;
if (m<=58) return "five to "+h;
return "h:m"; // never reached?
}
function daytime(h) {
if (!h || h>21) return " at night"
if (h<12) return " in the morning";
if (h<=17) return " in the afternoon";
return " in the evening"; // default
}
function ish(h,m) {
if (!h && !m) { // if no time supplied, use the system time
time = new Date()
h = time.getHours()
m = time.getMinutes()
}
z = daytime(h);
h = h % 12 // fix to 12 hour clock
if (m>57 && time.getSeconds()>30) m++; // round seconds
if (m>60) m=0 // round up minutes
if (m>33) h++ // round up hours
if (h>12) h = 1 // the clock turns round..
if (h==0) h = 12
return "It's now about "+ishtime(h,m)+z+"."
}
document.writeln(ish().fontcolor("black"),"<P>")

</script>

=====================================================
 
D

Don Schmidt

Found you on this try!

The one that reads "Good morning! It was Saturday October 25, 2008 at 7:41
AM. When you logged on!" is what would fill the bill if the clock would
update the hours, minutes and seconds. (fussy engineers need accuracy! <G>)

I'd change it to read,

"Buon giorno! È Sabato, Ottobre 25, 2008 at 7:41 AM. La sua visita è
benvenuta!"

"Good day! It is Saturday, October 25, 2008 a 7:41 AM. Your visit is
welcome."

ciao,

don





Spike said:
Don

It's back up and hopefully they will leave it up. Look Quick :) One
of the scripts contained the web address of the author so I modified it to
read

www dot mydomain dot com from www.mydomain.com

I looked at your script and modified it for my test page
I put a continues clock on the page that you might look at

If geocities locks me out again I have an alternate plan
I will set up a sub domain on my own space with a unique domain name
.info names are going for 99 cents a month on my provider

Spike


Don Schmidt said:
I'll be watching for it.

Here is the script I really like; would change the text to Italian on my
Goomba website. It is very good except the time is static once the page
is opened. 'Been doing some guess and by-gosh tinkering trying to get a
dynamic clock to work but lack the know how here.

<p style="color:#000000"><font size= 2 face= verdana>

<SCRIPT LANGUAGE="JavaScript">
<!--
d = new Date();
dateText = "";
dayValue = d.getDay();
if (dayValue == 0)
dateText += "Sunday";
else if (dayValue == 1)
dateText += "Monday";
else if (dayValue == 2)
dateText += "Tuesday";
else if (dayValue == 3)
dateText += "Wednesday";
else if (dayValue == 4)
dateText += "Thursday";
else if (dayValue == 5)
dateText += "Friday";
else if (dayValue == 6)
dateText += "Saturday";

monthValue = d.getMonth();
dateText += " "
if (monthValue == 0)
dateText += "January";
if (monthValue == 1)
dateText += "February";
if (monthValue == 2)
dateText += "March";
if (monthValue == 3)
dateText += "April";
if (monthValue == 4)
dateText += "May";
if (monthValue == 5)
dateText += "June";
if (monthValue == 6)
dateText += "July";
if (monthValue == 7)
dateText += "August";
if (monthValue == 8)
dateText += "September";
if (monthValue == 9)
dateText += "October";
if (monthValue == 10)
dateText += "November";
if (monthValue == 11)
dateText += "December";

if (navigator.appName.indexOf('Microsoft') != -1)
dateText += " " + d.getDate() + ", " + (0000 + d.getYear());
else if (navigator.appName.indexOf('Netscape') != -1)
dateText += " " + d.getDate() + ", " + (1900 + d.getYear());

minuteValue = d.getMinutes();
if (minuteValue < 10)
minuteValue = "0" + minuteValue

hourValue = d.getHours();
if (hourValue < 12)
{
greeting = "Good morning!";
timeText = " at " + hourValue + ":" + minuteValue +
" AM. Welcome to our site.";
}
else if (hourValue == 12)
{
greeting = "Good afternoon!";
timeText = " at " + hourValue + ":" + minuteValue +
" PM. Welcome to our site.";
}
else if (hourValue < 17)
{
greeting = "Good afternoon!";
timeText = " at " + (hourValue-12) + ":" + minuteValue +
" PM. Welcome to our site.";
}
else
{
greeting = "Good evening!";
timeText = " at " + (hourValue-12) + ":" + minuteValue +
" PM. Welcome to our site.";
}
document.open();
document.write(greeting + " It's " + dateText + timeText);
// -->
</SCRIPT>

Ciao,

Don






Spike said:
Don
Yes I see that
Thanks for posting that

Trying to get that resolved (it worked for a while)
It is a free service and they do not allow redirects or reference links
out of their system. WELL!! The scripts had links in the comments
section referencing the script author. There are no visible or
invisible links on the web page to click on. I assume that geocities
web crawler saw those and locked it out. I put spaces in the links to
see if that will do the trick and I am waiting for a reply from them.
Oh well what can you expect for a FREE service. Geocities comes with
yahoo e-mail account. This has nothing to do directly with Publisher
2000 .2 ,3 ,7 but it may be of interest to the readers. If I get it
resolved I will post back.

Spike

The site address returns,

"Sorry, unused."

don


Don
http://geocities.com/spikestestpage/

The three scripts in action

Spike

Finally had some time to give the three scripts a try; the first two
failed to show anything on the website, glitch in the script?

The third with "It's approximately" leaves a queasy feeling to this
ol engineer. <G>

Don


Don

Here are three scripts that you might want for your test page

No extra codes needed one of them needs countdown.js in web page
folder

Have fun

Spike

=====================================================
<script language="JavaScript">
TargetDate = new Date();
BackColor = "transparent";
ForeColor = "navy";
CountActive = true;
CountStepper = 1;
LeadingZero = true;
DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%%
Seconds.";
FinishMessage = "It is finally here!";
</script>
<script language="JavaScript" src="countdown.js"></script>

=====================================================
=====================================================

<SCRIPT Language="JavaScript">

<!--
// Week of the year script - By Ada Shimar ([email protected])
// Based on code by Duncan Kabinu, Florida Department of
Agriculture.
// Modified by Italian anonimous on 19.08.2002
// Visit JavaScript Kit (http://javascriptkit.com) for this script
and 400+ more

function weekNo() {
var totalDays = 0;
now = new Date();
years=now.getYear();
var days = new Array(12); // Array to hold the total days in a month
days[0] = 31;
days[2] = 31;
days[3] = 30;
days[4] = 31;
days[5] = 30;
days[6] = 31;
days[7] = 31;
days[8] = 30;
days[9] = 31;
days[10] = 30;
days[11] = 31;

// Check to see if this is a leap year
if (Math.round(now.getYear()/4) == now.getYear()/4) {
days[1] = 29
}else{
days[1] = 28
}

// If this is January no need for any fancy calculation otherwise
figure out the
// total number of days to date and then determine what week
if (now.getMonth() == 0) {
totalDays = totalDays + now.getDate();
}else{
var curMonth = now.getMonth();
for (var count = 1; count <= curMonth; count++) {
totalDays = totalDays + days[count - 1];
}
totalDays = totalDays + now.getDate();
}
// Here is the modification: considering when start the 1st week of
year.
// Originally was only: var week = Math.round(totalDays/7)
// Check if browser is "Microsoft Internet Explorer" or not and
apply the right var
var agt=navigator.userAgent.toLowerCase();
if ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)) {
var firstday=new Date("01/01/"+String(now.getYear())).getDay();
}
else {
var firstday=new Date("01/01/"+String(1900+now.getYear())).getDay();
}
var diff=7-firstday+1;
var week = Math.round((totalDays+diff-firstday)/7); return week;
}

document.write("Welcome to <b>week "+weekNo()+"<\/b> of "+years+"!")
// -->
</SCRIPT>

=====================================================
=====================================================

<script language="JavaScript">

/*
Plain English Time
By Adam Brown ([email protected])
For this script and more,
Visit http://javascriptkit.com
*/

function number(x) {
if (x==1) return "one"; if (x==2) return "two"; if (x==3) return
"three";
if (x==4) return "four"; if (x==5) return "five"; if (x==6) return
"six";
if (x==7) return "seven"; if (x==8) return "eight"; if (x==9) return
"nine";
if (x==10) return "ten"; if (x==11) return "eleven"; if (x==12)
return "twelve";
return x; //default
}
function ishtime(h,m) {
h = number(h)
if (m<=3 || m>57) return h+" o'clock";
if (m<=7) return "five past "+h;
if (m<=12) return "ten past "+h;
if (m<=17) return "quarter past "+h;
if (m<=23) return "twenty past "+h;
if (m<=28) return "twenty-five past "+h;
if (m<=33) return "half past "+h;
if (m<=38) return "twenty-five to "+h;
if (m<=43) return "twenty to "+h;
if (m<=48) return "quarter to "+h;
if (m<=53) return "ten to "+h;
if (m<=58) return "five to "+h;
return "h:m"; // never reached?
}
function daytime(h) {
if (!h || h>21) return " at night"
if (h<12) return " in the morning";
if (h<=17) return " in the afternoon";
return " in the evening"; // default
}
function ish(h,m) {
if (!h && !m) { // if no time supplied, use the system time
time = new Date()
h = time.getHours()
m = time.getMinutes()
}
z = daytime(h);
h = h % 12 // fix to 12 hour clock
if (m>57 && time.getSeconds()>30) m++; // round seconds
if (m>60) m=0 // round up minutes
if (m>33) h++ // round up hours
if (h>12) h = 1 // the clock turns round..
if (h==0) h = 12
return "It's now about "+ishtime(h,m)+z+"."
}
document.writeln(ish().fontcolor("black"),"<P>")

</script>

=====================================================
 
S

Spike

Don

I believe that the only way to have the clock update is to make the script
active with a body tag

Here is one that I modified:

You must add onLoad="showclock()" in <body ...> each time you
update the site, Yes it's a pain but then !!!

From the remarks you can see where I got the basic idea

For your use
Modify the two lines below between the " "
before="Hey Dude: it's"
after=" So there !"
to:
before="Buon giorno! È Sabato, "
after"="La sua visita è benvenuta!"

Edit the line containing:
font color='000999' face='verdana' size='4'
To the color, fone and size you want
==================================
Html code fragment folows

==================================


<script>

/*
Live Date Script-
© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions, 100's more DHTML scripts,
and Terms Of Use,
visit http://www.dynamicdrive.com
*/


var dayarray=new
Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new
Array("January","February","March","April","May","June","July","August","September","October","November","December")

function getthedate(){
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var hours=mydate.getHours()
var minutes=mydate.getMinutes()
var seconds=mydate.getSeconds()
var dn="AM"
if (hours>=12)
dn="PM"
before="Hey Dude: it's"
after=" So there !"
if (hours>12){
hours=hours-12
}
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
//change font size here
var cdate="<small><font color='000999' face='verdana' size='4'><b>"+before+"
"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+"
"+hours+":"+minutes+":"+seconds+" "+dn
+", "+after+"</b></font></small>"
if (document.all)
document.all.clock.innerHTML=cdate
else if (document.getElementById)
document.getElementById("clock").innerHTML=cdate
else
document.write(cdate)
}
if (!document.all&&!document.getElementById)
getthedate()
function showclock(){
if (document.all||document.getElementById)
setInterval("getthedate()",1000)
}

</script>

<span id="clock"></span>

=====================================
end of code fragment
=====================================

As for your comment "fussy engineers need accuracy!, I retired after 41
years in the electronics field relating to air traffic control. Tell me
about it :) !

Having a clock that says the time is about Two Thirty in the afternoon is a
escape route TO sanity. :)
I will add this script to my page after I modify the www.mydomain.com so
I don't get locked out again

Spike
 
D

Don Schmidt

At www.vanusa.org is where I have the script below with a running clock.
I'm tinkering to add the text on both ends of it to get to the script I'd
like to have

Don

<script language=Javascript1.2>
<!--

var tags_before_clock = " "
var tags_middle_clock = " "
var tags_after_clock = " "

if(navigator.appName == "Netscape") {
document.write('<font size= 2 face= verdana><layer
id="clock"></layer><br>');
}

if (navigator.appVersion.indexOf("MSIE") != -1){
document.write('<font size= 2 face= verdana><span id="clock"></span>');
}

DaysofWeek = new Array()
DaysofWeek[0]="Sunday"
DaysofWeek[1]="Monday"
DaysofWeek[2]="Tuesday"
DaysofWeek[3]="Wednesday"
DaysofWeek[4]="Thursday"
DaysofWeek[5]="Friday"
DaysofWeek[6]="Saturday"

Months = new Array()
Months[0]="January"
Months[1]="February"
Months[2]="March"
Months[3]="April"
Months[4]="May"
Months[5]="June"
Months[6]="July"
Months[7]="August"
Months[8]="September"
Months[9]="October"
Months[10]="November"
Months[11]="December"

function upclock(){
var dte = new Date();
var hrs = dte.getHours();
var min = dte.getMinutes();
var sec = dte.getSeconds();
var day = DaysofWeek[dte.getDay()]
var date = dte.getDate()
var month = Months[dte.getMonth()]
var year = dte.getFullYear()

var col = ":";
var spc = " ";
var com = ",";
var apm;

if (date == 1 || date == 21 || date == 31)
{ender = "<sup>st</sup>"}
else
if (date == 2 || date == 22)
{ender = "<sup>nd</sup>"}
else
if (date == 3 || date == 23)
{ender = "<sup>rd</sup>"}

else
{ender = "<sup>th</sup>"}

if (12 < hrs) {
apm="<font size='-1'>pm</font>";
hrs-=12;
}

else {
apm="<font size='-1'>am</font>";
}

if (hrs == 0) hrs=12;
if (hrs<=9) hrs="0"+hrs;
if (min<=9) min="0"+min;
if (sec<=9) sec="0"+sec;

if(navigator.appName == "Netscape") {
document.clock.document.write(tags_before_clock+hrs+col+min+col+sec+apm+spc+tags_middle_clock+spc+day+com+spc+date+ender+spc+month+com+spc+year+tags_after_clock);
document.clock.document.close();
}

if (navigator.appVersion.indexOf("MSIE") != -1){
clock.innerHTML =
tags_before_clock+hrs+col+min+col+sec+apm+spc+tags_middle_clock+spc+day+com+spc+date+ender+spc+month+com+spc+year+tags_after_clock;
}
}

setInterval("upclock()",1000);
//-->
</script>









Spike said:
Don

I believe that the only way to have the clock update is to make the script
active with a body tag

Here is one that I modified:

You must add onLoad="showclock()" in <body ...> each time
you update the site, Yes it's a pain but then !!!

From the remarks you can see where I got the basic idea

For your use
Modify the two lines below between the " "
before="Hey Dude: it's"
after=" So there !"
to:
before="Buon giorno! È Sabato, "
after"="La sua visita è benvenuta!"

Edit the line containing:
font color='000999' face='verdana' size='4'
To the color, fone and size you want
==================================
Html code fragment folows

==================================


<script>

/*
Live Date Script-
© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions, 100's more DHTML scripts,
and Terms Of Use,
visit http://www.dynamicdrive.com
*/


var dayarray=new
Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new
Array("January","February","March","April","May","June","July","August","September","October","November","December")

function getthedate(){
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var hours=mydate.getHours()
var minutes=mydate.getMinutes()
var seconds=mydate.getSeconds()
var dn="AM"
if (hours>=12)
dn="PM"
before="Hey Dude: it's"
after=" So there !"
if (hours>12){
hours=hours-12
}
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
//change font size here
var cdate="<small><font color='000999' face='verdana'
size='4'><b>"+before+" "+dayarray[day]+", "+montharray[month]+" "+daym+",
"+year+" "+hours+":"+minutes+":"+seconds+" "+dn
+", "+after+"</b></font></small>"
if (document.all)
document.all.clock.innerHTML=cdate
else if (document.getElementById)
document.getElementById("clock").innerHTML=cdate
else
document.write(cdate)
}
if (!document.all&&!document.getElementById)
getthedate()
function showclock(){
if (document.all||document.getElementById)
setInterval("getthedate()",1000)
}

</script>

<span id="clock"></span>

=====================================
end of code fragment
=====================================

As for your comment "fussy engineers need accuracy!, I retired after 41
years in the electronics field relating to air traffic control. Tell me
about it :) !

Having a clock that says the time is about Two Thirty in the afternoon is
a escape route TO sanity. :)
I will add this script to my page after I modify the www.mydomain.com so
I don't get locked out again

Spike
 
S

Spike

WOW

I was incorrect (never to old to learn) :)
You have it running without a body tag
I put in text before and after and works great
Thanks

Spike



Don Schmidt said:
At www.vanusa.org is where I have the script below with a running clock.
I'm tinkering to add the text on both ends of it to get to the script I'd
like to have

Don

<script language=Javascript1.2>
<!--

var tags_before_clock = " "
var tags_middle_clock = " "
var tags_after_clock = " "

if(navigator.appName == "Netscape") {
document.write('<font size= 2 face= verdana><layer
id="clock"></layer><br>');
}

if (navigator.appVersion.indexOf("MSIE") != -1){
document.write('<font size= 2 face= verdana><span id="clock"></span>');
}

DaysofWeek = new Array()
DaysofWeek[0]="Sunday"
DaysofWeek[1]="Monday"
DaysofWeek[2]="Tuesday"
DaysofWeek[3]="Wednesday"
DaysofWeek[4]="Thursday"
DaysofWeek[5]="Friday"
DaysofWeek[6]="Saturday"

Months = new Array()
Months[0]="January"
Months[1]="February"
Months[2]="March"
Months[3]="April"
Months[4]="May"
Months[5]="June"
Months[6]="July"
Months[7]="August"
Months[8]="September"
Months[9]="October"
Months[10]="November"
Months[11]="December"

function upclock(){
var dte = new Date();
var hrs = dte.getHours();
var min = dte.getMinutes();
var sec = dte.getSeconds();
var day = DaysofWeek[dte.getDay()]
var date = dte.getDate()
var month = Months[dte.getMonth()]
var year = dte.getFullYear()

var col = ":";
var spc = " ";
var com = ",";
var apm;

if (date == 1 || date == 21 || date == 31)
{ender = "<sup>st</sup>"}
else
if (date == 2 || date == 22)
{ender = "<sup>nd</sup>"}
else
if (date == 3 || date == 23)
{ender = "<sup>rd</sup>"}

else
{ender = "<sup>th</sup>"}

if (12 < hrs) {
apm="<font size='-1'>pm</font>";
hrs-=12;
}

else {
apm="<font size='-1'>am</font>";
}

if (hrs == 0) hrs=12;
if (hrs<=9) hrs="0"+hrs;
if (min<=9) min="0"+min;
if (sec<=9) sec="0"+sec;

if(navigator.appName == "Netscape") {
document.clock.document.write(tags_before_clock+hrs+col+min+col+sec+apm+spc+tags_middle_clock+spc+day+com+spc+date+ender+spc+month+com+spc+year+tags_after_clock);
document.clock.document.close();
}

if (navigator.appVersion.indexOf("MSIE") != -1){
clock.innerHTML =
tags_before_clock+hrs+col+min+col+sec+apm+spc+tags_middle_clock+spc+day+com+spc+date+ender+spc+month+com+spc+year+tags_after_clock;
}
}

setInterval("upclock()",1000);
//-->
</script>









Spike said:
Don

I believe that the only way to have the clock update is to make the
script active with a body tag

Here is one that I modified:

You must add onLoad="showclock()" in <body ...> each time
you update the site, Yes it's a pain but then !!!

From the remarks you can see where I got the basic idea

For your use
Modify the two lines below between the " "
before="Hey Dude: it's"
after=" So there !"
to:
before="Buon giorno! È Sabato, "
after"="La sua visita è benvenuta!"

Edit the line containing:
font color='000999' face='verdana' size='4'
To the color, fone and size you want
==================================
Html code fragment folows

==================================


<script>

/*
Live Date Script-
© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions, 100's more DHTML
scripts, and Terms Of Use,
visit http://www.dynamicdrive.com
*/


var dayarray=new
Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new
Array("January","February","March","April","May","June","July","August","September","October","November","December")

function getthedate(){
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var hours=mydate.getHours()
var minutes=mydate.getMinutes()
var seconds=mydate.getSeconds()
var dn="AM"
if (hours>=12)
dn="PM"
before="Hey Dude: it's"
after=" So there !"
if (hours>12){
hours=hours-12
}
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
//change font size here
var cdate="<small><font color='000999' face='verdana'
size='4'><b>"+before+" "+dayarray[day]+", "+montharray[month]+" "+daym+",
"+year+" "+hours+":"+minutes+":"+seconds+" "+dn
+", "+after+"</b></font></small>"
if (document.all)
document.all.clock.innerHTML=cdate
else if (document.getElementById)
document.getElementById("clock").innerHTML=cdate
else
document.write(cdate)
}
if (!document.all&&!document.getElementById)
getthedate()
function showclock(){
if (document.all||document.getElementById)
setInterval("getthedate()",1000)
}

</script>

<span id="clock"></span>

=====================================
end of code fragment
=====================================

As for your comment "fussy engineers need accuracy!, I retired after 41
years in the electronics field relating to air traffic control. Tell me
about it :) !

Having a clock that says the time is about Two Thirty in the afternoon is
a escape route TO sanity. :)
I will add this script to my page after I modify the www.mydomain.com
so I don't get locked out again

Spike
 
S

Spike

Don

BTW

This forum can cause a problem now and then
The width of text allowed will put a line break in the middle of a line and
render some scripts useless
as in the one you posted

document.write('<font size= 2 face= verdana><layer
and
id="clock"></layer><br>');

MUST be on one line

I think maybe one of the ones I posted to you had the same thing happen and
could be why they did not work for you

Spike


Don Schmidt said:
At www.vanusa.org is where I have the script below with a running clock.
I'm tinkering to add the text on both ends of it to get to the script I'd
like to have

Don

<script language=Javascript1.2>
<!--

var tags_before_clock = " "
var tags_middle_clock = " "
var tags_after_clock = " "

if(navigator.appName == "Netscape") {
document.write('<font size= 2 face= verdana><layer
id="clock"></layer><br>');
}

if (navigator.appVersion.indexOf("MSIE") != -1){
document.write('<font size= 2 face= verdana><span id="clock"></span>');
}

DaysofWeek = new Array()
DaysofWeek[0]="Sunday"
DaysofWeek[1]="Monday"
DaysofWeek[2]="Tuesday"
DaysofWeek[3]="Wednesday"
DaysofWeek[4]="Thursday"
DaysofWeek[5]="Friday"
DaysofWeek[6]="Saturday"

Months = new Array()
Months[0]="January"
Months[1]="February"
Months[2]="March"
Months[3]="April"
Months[4]="May"
Months[5]="June"
Months[6]="July"
Months[7]="August"
Months[8]="September"
Months[9]="October"
Months[10]="November"
Months[11]="December"

function upclock(){
var dte = new Date();
var hrs = dte.getHours();
var min = dte.getMinutes();
var sec = dte.getSeconds();
var day = DaysofWeek[dte.getDay()]
var date = dte.getDate()
var month = Months[dte.getMonth()]
var year = dte.getFullYear()

var col = ":";
var spc = " ";
var com = ",";
var apm;

if (date == 1 || date == 21 || date == 31)
{ender = "<sup>st</sup>"}
else
if (date == 2 || date == 22)
{ender = "<sup>nd</sup>"}
else
if (date == 3 || date == 23)
{ender = "<sup>rd</sup>"}

else
{ender = "<sup>th</sup>"}

if (12 < hrs) {
apm="<font size='-1'>pm</font>";
hrs-=12;
}

else {
apm="<font size='-1'>am</font>";
}

if (hrs == 0) hrs=12;
if (hrs<=9) hrs="0"+hrs;
if (min<=9) min="0"+min;
if (sec<=9) sec="0"+sec;

if(navigator.appName == "Netscape") {
document.clock.document.write(tags_before_clock+hrs+col+min+col+sec+apm+spc+tags_middle_clock+spc+day+com+spc+date+ender+spc+month+com+spc+year+tags_after_clock);
document.clock.document.close();
}

if (navigator.appVersion.indexOf("MSIE") != -1){
clock.innerHTML =
tags_before_clock+hrs+col+min+col+sec+apm+spc+tags_middle_clock+spc+day+com+spc+date+ender+spc+month+com+spc+year+tags_after_clock;
}
}

setInterval("upclock()",1000);
//-->
</script>









Spike said:
Don

I believe that the only way to have the clock update is to make the
script active with a body tag

Here is one that I modified:

You must add onLoad="showclock()" in <body ...> each time
you update the site, Yes it's a pain but then !!!

From the remarks you can see where I got the basic idea

For your use
Modify the two lines below between the " "
before="Hey Dude: it's"
after=" So there !"
to:
before="Buon giorno! È Sabato, "
after"="La sua visita è benvenuta!"

Edit the line containing:
font color='000999' face='verdana' size='4'
To the color, fone and size you want
==================================
Html code fragment folows

==================================


<script>

/*
Live Date Script-
© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions, 100's more DHTML
scripts, and Terms Of Use,
visit http://www.dynamicdrive.com
*/


var dayarray=new
Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new
Array("January","February","March","April","May","June","July","August","September","October","November","December")

function getthedate(){
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var hours=mydate.getHours()
var minutes=mydate.getMinutes()
var seconds=mydate.getSeconds()
var dn="AM"
if (hours>=12)
dn="PM"
before="Hey Dude: it's"
after=" So there !"
if (hours>12){
hours=hours-12
}
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
//change font size here
var cdate="<small><font color='000999' face='verdana'
size='4'><b>"+before+" "+dayarray[day]+", "+montharray[month]+" "+daym+",
"+year+" "+hours+":"+minutes+":"+seconds+" "+dn
+", "+after+"</b></font></small>"
if (document.all)
document.all.clock.innerHTML=cdate
else if (document.getElementById)
document.getElementById("clock").innerHTML=cdate
else
document.write(cdate)
}
if (!document.all&&!document.getElementById)
getthedate()
function showclock(){
if (document.all||document.getElementById)
setInterval("getthedate()",1000)
}

</script>

<span id="clock"></span>

=====================================
end of code fragment
=====================================

As for your comment "fussy engineers need accuracy!, I retired after 41
years in the electronics field relating to air traffic control. Tell me
about it :) !

Having a clock that says the time is about Two Thirty in the afternoon is
a escape route TO sanity. :)
I will add this script to my page after I modify the www.mydomain.com
so I don't get locked out again

Spike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top