fruzzgle Posted May 29, 2006 Share Posted May 29, 2006 This isn't much but I couldn't find anything that would show you the updated time without refreshing the browser. What I mean by this, I have the following code (very simple, this is just a test I'm doing after looking at a date tutorial).[code]<?phpecho(date("l h:i:s a"));?>[/code]This shows you the day of the week and the hour, minut, seconds and either am or pm . Example: Monday 06:54:49 pmBut to see what time it is you need to refresh the page to see the updated time. How do I make it so you don't have to refresh and your see the time go Monday 06:54:49 pm Monday 06:54:50 pm Monday 06:54:51 pm Monday 06:54:52 pmAnd so on. I explained it the best I could but if you don't know what I'm talking about I'll try to re-explain it. Quote Link to comment https://forums.phpfreaks.com/topic/10723-date/ Share on other sites More sharing options...
kenrbnsn Posted May 29, 2006 Share Posted May 29, 2006 That can only be done with Javascript.Ken Quote Link to comment https://forums.phpfreaks.com/topic/10723-date/#findComment-40038 Share on other sites More sharing options...
AndyB Posted May 29, 2006 Share Posted May 29, 2006 If you want 'live' time on a page without refreshing, then you have to use javascript (or an applet). It can't be done with php. Google for "javascript clock" and you'll find hundreds of scripts that'll work. Quote Link to comment https://forums.phpfreaks.com/topic/10723-date/#findComment-40039 Share on other sites More sharing options...
a1ias Posted May 29, 2006 Share Posted May 29, 2006 Hi fruzzgleI'm pretty new to php myself and have been hunting down a good php resource site for a while - looks like I found one :)Anyway, I see your post and notice that noone has replied as yet so I figure I'd have a bash myself. I've only been learning php for about 2 weeks now but I've not yet come across a way to do what you want without using Javascript.Not sure if I'm allowed to post this so if not, an admin may remove it, but you could try [a href=\"http://www.dynamicdrive.com/dynamicindex6/index.html\" target=\"_blank\"]This[/a] link. Quote Link to comment https://forums.phpfreaks.com/topic/10723-date/#findComment-40040 Share on other sites More sharing options...
fruzzgle Posted May 29, 2006 Author Share Posted May 29, 2006 Thanks for you help! Quote Link to comment https://forums.phpfreaks.com/topic/10723-date/#findComment-40059 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.