prudens Posted June 13, 2008 Share Posted June 13, 2008 Hi, How do you do a live clock in PHP? Like 06-01-2008, 10:39:01 ? How do you make the seconds "tick" live??? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/110020-php-live-clock/ Share on other sites More sharing options...
corbin Posted June 13, 2008 Share Posted June 13, 2008 Google "ticking clock javascript." PHP isn't exactly the best choice for this.... Quote Link to comment https://forums.phpfreaks.com/topic/110020-php-live-clock/#findComment-564560 Share on other sites More sharing options...
defeated Posted June 13, 2008 Share Posted June 13, 2008 I wanted the same for my site. It will not happen. The clock will only refresh when the page is refreshed in php. I used liveclock.js found on google. If a user has java turned off then it won't show so I put it in a place where it won't matter and did not put any further text around it. You don't want to have "The current time is: " showing on your site. Check out how I implemented it at http://www.jackiebrownmedical.ie Ian. Quote Link to comment https://forums.phpfreaks.com/topic/110020-php-live-clock/#findComment-564614 Share on other sites More sharing options...
Darklink Posted June 13, 2008 Share Posted June 13, 2008 The only way to do this is by using JavaScript or another web application language like Java or flash. Quote Link to comment https://forums.phpfreaks.com/topic/110020-php-live-clock/#findComment-564707 Share on other sites More sharing options...
tapos Posted June 13, 2008 Share Posted June 13, 2008 U can't do the live thing using a serverside scripting language, you must need a client side scripting language and Javascript is the best choice for that Quote Link to comment https://forums.phpfreaks.com/topic/110020-php-live-clock/#findComment-564711 Share on other sites More sharing options...
PFMaBiSmAd Posted June 13, 2008 Share Posted June 13, 2008 I'll ask the obvious question - why do you want to do this? Most of the people on the planet sit in front of a computer that has the current time displayed somewhere on their monitor. They don't need a web site to be displaying the same information (and web servers are often in a different time zone than the visitor so unless you adjust the time to the visitor or use the javascript suggestions, the time displayed is wrong anyway.) Quote Link to comment https://forums.phpfreaks.com/topic/110020-php-live-clock/#findComment-564932 Share on other sites More sharing options...
defeated Posted June 17, 2008 Share Posted June 17, 2008 Quote I'll ask the obvious question - why do you want to do this? I thought the same. My site had a live clock on it but it was in an input on the page so I couldn't get the page to validate without adding in a whole form to go with it. So when I redid the site using css instead of tables I left the clock out. All of a sudden I started getting mails from people who used the site for the clock. 6 of them had bookmarked the page so that they could call it up for the time and date. Others just liked it and thought I should put it back. So it's back... but not in an input this time. My site is a very local site (Ireland) and visitors from outside the country are not much good to our business so I don't much care about the time coming up wrong in other time zones (if it is). My view now is that it is completely unneccessary to have a clock on your site but it is harmless and I personally quite like it. It adds a bit of movement to an otherwise static page without having to put in flash etc. Quote Link to comment https://forums.phpfreaks.com/topic/110020-php-live-clock/#findComment-567126 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.