Visit the LQ Articles and Editorials section
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 06-04-2010, 08:15 AM   #1
LQ Newbie
Registered: Apr 2010
Posts: 8

Rep: Reputation: 0
Current system time on PHP Webpage

Hi Folks,
I want to display the current system (linux) time
in the webpage using PHP code
I have tried numerous codes had a mismatched time.
Finally I have tried the code :

$date = date('l dS \of F Y h:i:s A');

echo "$date";


Friday 04th of June 2010 07:58:53 AM

where as the actual system time is :
Friday 04th of June 2010 08:58:53 PM

The system local time is Japan/Tokyo.
Can anyone help me with the resolution to this issue
on priority.
Old 06-04-2010, 08:51 AM   #2
Registered: Sep 2004
Location: Old York, North Yorks.
Distribution: Debian 7 (mainly)
Posts: 653

Rep: Reputation: 88
Does Japan use daylight saving time?

If so, you can check whether this is set (in)correctly with:

1 = daylight saving, 0 = no daylight saving.

Also, the following will allow you to check whether php is picking up timezone data correctly:



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP: formatting current date & time as: 2006-04-12 13:47:36 and substract 15 minutes NaCo Linux - Software 4 11-13-2008 08:31 PM
PHP webpage issue Dillius Linux - General 1 07-11-2006 06:07 PM
Creating a webpage for the first time metallica1973 Linux - Software 2 03-09-2006 11:09 PM
Getting PHP to print variable value on a webpage tangle Programming 9 02-07-2006 03:39 PM
Apache doesn't display php webpage rover SUSE / openSUSE 2 11-08-2004 11:07 AM

All times are GMT -5. The time now is 11:37 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration