Jump to content

Make a Date and time script


justin15

Recommended Posts

I am trying to make a date and time script that will 'refresh' every second, I would like for the just the script to reload, and not the entire page, because if you have a big page, it will take long to keep reloading the page every second.

So, has of now, I have a working script which reloads the page, and does it guick, because its jus tthe plain page. If anyone knows the answer to this SIMPLE guestion, please let me know.

Heres the page itself
[a href=\"http://24.215.127.102/PHP/date.php\" target=\"_blank\"]Click here for the page[/a]

Heres the code
[code]
<META HTTP-EQUIV="Refresh"
CONTENT="1; URL=date.php">

<?PHP
$today = date("F j, Y, g:i:s A");

echo "<B>Time and Date: $today</B>";


?>
[/code]
Link to comment
Share on other sites

no no you need AJAX to do that kind of small update to the page. I suppose it would be like to take the time with php and then in java add 1 second every second an update the area with the date inside it, or else get the time from java itself and not use php at all.
Link to comment
Share on other sites

[!--quoteo(post=382519:date=Jun 11 2006, 11:02 AM:name=joquius)--][div class=\'quotetop\']QUOTE(joquius @ Jun 11 2006, 11:02 AM) [snapback]382519[/snapback][/div][div class=\'quotemain\'][!--quotec--]
... not use php at all.
[/quote]
Right. That's exactly what javascript 'clocks' are meant to do.
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.