phpeveryday.com

The best tutorial of php, php framework, php strategies, object oriented oriented,


PHP Time: Showing Server Date and Time Using PHP and JavaScript

Tag: date, time, server time, javascript   Category: PHP Classes
post: 03 Jan 2008 read: 1,071


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.




| Give Your Opinion | Recommend
Share and Bookmark to: These icons link to social bookmarking sites where readers can share and discover new web pages.
digg del.icio.us technorati Ma.gnolia BlinkList

Recommended articles by other readers:
Web Services: How PHP Kiss VB.NET? (Part 1)
Chart: How to Build Cool Animation Real Time Chart
Joomla: Fast Road to Understand Component Programming
Email: Send Attachement Mail
mod_rewrite - Part 1: create your "fantasy" URL

What do You Think?
Your Name *:
Email *:
(Will not be published)
Website/URL:
Your Comment *:
* Required


615
posting