Display time with PHP
We use the PHP function date( ) to display the time, we need 4 parameters for the date() function:
date (“hour,minute,second,am/pm”);
For hour:
“H” – 24 hours time system.
“h” – 12 hours time system.
For minute: “i”
For second: “s”
For AM and PM:
“A”in capital letters.
“a” in small letters.
Here are some examples:
we get: [exec]echo date(“H:i:s”);[/exec]
Press the refresh button to refresh the time.
we get: [exec]echo date(“h:i:s a”);[/exec]
Press the refresh button to refresh the time.
It can only display that instance of the server time. To make a real time clock with PHP, I only can think of using PHP code to refresh the page every second.





