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?

Member Avatar for diafol

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.