View Full Version : Local Time Script & Frontpage

03-19-2006, 01:39 AM
Local Time Script

Hi everyone, I have been pulling my hair out over this one. I followed the directions on the site, but I don't comprehend everything. I am still a beginner.

I made a simple page, but all that would show is
"Current Server Time:NaN:NaN:NaN AM (undefined)"

I am not sure what the problem is. I think it is either:
1. frontpage 2003 is giving me problems
2. my page might be 100% html, so my page is not configured to display things properly.
3. my server is not set up correctly

note: I am using IX web hosting on their expert plan and I have SSI, PHP and frontpage extensions on.

Here is the actual page:

Please save me from going balder. Any suggestions?

03-19-2006, 05:34 AM
From what I can tell, your page is correct. A fine point, the title should go before the script, shouldn't make any practical difference but is good valid form and practice. The trouble is that since you are using the php method, your page's extension needs to be .php not .htm:

From the Demo Page:

Description: Want to display the current local time of a specific place in the world? This DHTML script, with the help of either PHP, ASP, or SSI (server side includes), displays the current server time your site is hosted on, and in turn, the local time of anywhere on Earth. You can use it to show visitors your current local time, or the time in New York, Tokyo etc. Now, in order to use this script, the webpage you're adding it to must be either PHP (ie: .php), ASP, or SSI (ie: .shtml) enabled. More on this below.

03-19-2006, 09:21 AM
Hi jscheuer1,

I tried the changes you suggested. I changed the file extension to .php and even moved the title above the script. However, it still doesn't work.

In IE, nothing displays.
In Firefox, just a bunch of garbage.

What to do?
Here is the new page by the way:

03-19-2006, 11:31 AM
How peculiar... PHP appears to be attempting to parse the ASP code. Change this:
var servertimestring=(servermode=="server-php")? '<? print date("F d, Y H:i:s", time())?>' : (servermode=="server-ssi")? '<!--#config timefmt="%B %d, %Y %H:%M:%S"--><!--#echo var="DATE_LOCAL" -->' : '<%= Now() %>'to this:
var servertimestring='<? print date("F d, Y H:i:s", time())?>';

03-19-2006, 12:07 PM
Twey, that did it. Thanks a great bunch.
Much Love and Peace, Kiet

03-20-2006, 01:33 AM
Hi, thanks to everyone for helping. I have one more question. I want to change the font of the words and the time. I can get the letters to change, but I can't seem to get the numbers to change. Any suggestions?

Here is the page with the new font (Verdana font size=1)

03-20-2006, 03:29 AM
You're off by 1pt. Since you've set the body to 8pt and the timecontainer span has no style and cannot (easily) have a <font> tag included, it is using the 8pt of the body. 7pt is very close though. You really shouldn't use the font tag anyway as it has been deprecated. In this particular case, if you set the body to 7pt and remove all font tags, you will be in business. However, pts and pixels are also poor choices for font size. % is ideal. The size you are looking for is about 60%. Now this makes for more problems though, many browser/system combos don't have Verdana available. It is a rather large font that is also more readable than most when displayed at a small size, so whatever is substituted in those situations is likely to be too small to read. At least if you do it as a percent, everybody can resize the text if they know how (IE cannot resize pts or pixels).

I'd replace:

<body style="font-family: Verdana; font-size: 8pt">

<div><font face="Verdana" size="1">Current Server Time:</font><span id="timecontainer"></span><font face="Verdana" size="1">

<script type="text/javascript">
new showLocalTime("timecontainer", "server-php", 0, "short")


<body style="font-family: Verdana; font-size: 60%">

<div>Current Server Time:<span id="timecontainer"></span>

<script type="text/javascript">
new showLocalTime("timecontainer", "server-php", 0, "short")

03-20-2006, 06:52 AM
<body style="font-family: Verdana, sans-serif; font-size: 60%;">
Current Server Time:<span id="timecontainer"></span>
<script type="text/javascript">
new showLocalTime("timecontainer", "server-php", 0, "short")
</div>Always specify an alternative generic font family. Also, Verdana isn't a good choice if you're worried about getting font sizes right, as it's considerably larger than other fonts.

03-21-2006, 11:24 PM
Thanks everyone for the great info. I like the way Verdana looks, but now I will reconsider it knowing its attributes. I will experiment with the percentage values as well.


07-20-2006, 10:06 AM
Hi, I am the original creator of this thread. I am trying to manage my online persona by deleting things that are related to me. I don't mind this thread existing, but I would like to remove all instances of anything that refers to me. I tried e-mailing the admin already, but I haven't gotten a reply yet. Can someone help me? I am even looking for the edit option, but it is not available.

Any help is appreciated. Thanks.

07-20-2006, 12:09 PM
Life's like that, I'm afraid. I myself have a particularly embarrassing scenario in which I wrote a long and sophisticated article completely refuting a CNet post, and then posted it to the wrong tab so it ended up on a completely unrelated article.

Even were this thread to be deleted, caches would still exist -- see archive.org and the Google caches.

07-20-2006, 05:13 PM
So, does this mean I cannot take down those naked photos of . . . :p

07-20-2006, 05:20 PM
Rofl :D

That's the problem with the Internet: everything's recorded. :p

07-20-2006, 11:57 PM
So is there nothing that I can really do?

Is an Admin available?

07-21-2006, 12:58 AM
ddadmin has been by recently, and I suspect he simply viewed this thread and didn't bother doing anything. He is the only admin on this board.
So is there nothing that I can really do?I don't think it's really a question of there being nothing you can do, but rather of there being no point in your doing it because the data is all stored elsewhere (on servers outside of ddadmin's control) anyway.

07-21-2006, 01:39 AM
Well, if this can't be deleted, can he at least let me edit my old posts to remove personal information? Or is that asking too much?

07-21-2006, 03:03 AM
I cannot speak for ddadmin except to say that I am sure he's busy and that you can contact him by pm. I'm sure he will respond eventually if you are patient. I'd give it a week but, he will probably get back to you sooner than that. To pm ddadmin, find one of his posts, click on his username (ddadmin) and then select:

Private Message:
Send a private message to ddadmin (http://www.dynamicdrive.com/forums/private.php?do=newpm&u=1)

Or just click on the above link in this message.

07-21-2006, 03:07 AM
can he at least let me edit my old posts to remove personal information
huh? :p i can edit my own post :D

07-21-2006, 03:18 AM
huh? :p i can edit my own post :D

Not after they are a certain age.