TheJeffsta 0 Report post Posted August 27, 2005 I am just wondering how to get the current time on a weboage. Ive got one that gets the info from the viewers computer, but i want one that gets the time from a server that has the current time and all of that. Can someone help me out with the code?I am currently using Microsoft Frontpage 2003. I also have Dreamweaver MX 2004 if its easier in that. Share this post Link to post Share on other sites
szupie 0 Report post Posted August 27, 2005 You can search something like "javascript display server time" on Google, and that should give you a lot of scripts. This is one of the scripts I found.If you want to write your own script, you can study the scripts you found to see how they work. Share this post Link to post Share on other sites
Houdini 0 Report post Posted August 27, 2005 That is easy with php and you could mix it into an html file (Xisto supports PHP so here's the big program.To see it work on your server just name the below tiny file something like time.php and put it on your Xisto server maybe in the root and then just typer http://forums.xisto.com/no_longer_exists/ and you will see the time and if you need more about how to use it or include it in a header and or footer thenit could be displayed in the top and bottom of your pages. Here's the tiny code <?php$time=date("g:i:s;a");echo ($time);?> Hope that helps. Share this post Link to post Share on other sites
yordan 10 Report post Posted August 27, 2005 thanks, Houdini, it works. You made me write down my first php program. (Sorry, you explained me how to cut-and-paste into my first php program).It's nice to see something new working at first time. Share this post Link to post Share on other sites
Houdini 0 Report post Posted August 27, 2005 You are welcome, it was simple that is what I love about PHP it can do some pretty neat stuuf with little effort. All you need is a goo reference on the date funtions, then you can format your time anyway you want, you could also get more sophisticated and have it refresh every second but that is just a little much.Glad it helped you out! Share this post Link to post Share on other sites
koolio 0 Report post Posted August 30, 2005 The only disadvantage of the above script is that it displays the time at the moment of generation and it doesn't change as time goes by as in a real clock. So I searched for a script which displays time continuously. Check this.http://forums.xisto.com/no_longer_exists/ Share this post Link to post Share on other sites
TheJeffsta 0 Report post Posted August 31, 2005 OMG, that code is soo big. I prefer the one that i have on my site at the moment.http://forums.xisto.com/no_longer_exists/The only downside is that is takes about 5-10 seconds to load. Oh and it could have done with a better layout (appearance). Share this post Link to post Share on other sites