0

Hello friends:)

I have put this in my script to echo the current date and time:

<?php
    print strftime('%c');
?>

And with this code:

<?php
    $p = $_SERVER['PHP_SELF'];
    $sec = "0.01";
    header("Refresh: $sec; url=$p");
?>

tried to refresh the page in order to show a real clock, i mean a clock wich works well with no problem.
But the script refresh the page very fast without stopping and it doesn't sound good, for example the red circle on the tab that is orbiting so fast with unpleasent pusses because of loading, that's not good. Is there any other way to fix it?

2
Contributors
1
Reply
12
Views
2 Years
Discussion Span
Last Post by diafol
0

WHy do you need to do this? Everybody has a system clock don't they? DO you really need to show the time, which will, by the way probably be for your chosen timezone, not necessarily that of your users.

You can't do this with PHP anyway, it would be insane. You can mimic it with JS though. But pretty pointless.

Edited by diafol

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.