PHP Time: Showing Server Date and Time Using PHP and JavaScript
PHP Time Tutorial: In this post, we will learn how to show server date and time to browser. May we want to synchronize server and client time. It is applied for real time application like for forex web application and so on.
For this job, we need help from servertime class. You can get this class from http://www.ingoknito.de. Please download.
After download, place inc_servertime.php within directory www/test/servertime. Then create a file named "test.php". Enter following code:
<html> <head> <? include 'inc_servertime.php'; $st = new servertime; $st->lang = 'english'; $st->shortmonth = true; $st->InstallClockHead(); ?> </head> <body> <? $st->title = 'Our server: '; $st->InstallClock(); $st->InstallClockBody(); ?> </body> </html>
Point your browser to http://localhost/test/servertime/test.php.
Tag: date, time, server time, javascript Category: PHP Classes Post : January 03rd 2008 Read: 2,726
blog comments powered by Disqus
