Jump to content

Date


fruzzgle

Recommended Posts

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]<?php
echo(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 pm

But 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 pm

And 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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

Hi fruzzgle

I'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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.