LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-04-2010, 07:15 AM   #1
pashy
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 :
<?php

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

echo "$date";

?>

Output:
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, 07:51 AM   #2
Robhogg
Member
 
Registered: Sep 2004
Location: Old York, North Yorks.
Distribution: Debian 7 (mainly)
Posts: 653

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

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

Code:
echo(date('I'));
1 = daylight saving, 0 = no daylight saving.

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

Code:
echo(date('e'));
 
  


Reply



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 07:31 PM
PHP webpage issue Dillius Linux - General 1 07-11-2006 05:07 PM
Creating a webpage for the first time metallica1973 Linux - Software 2 03-09-2006 10:09 PM
Getting PHP to print variable value on a webpage tangle Programming 9 02-07-2006 02:39 PM
Apache doesn't display php webpage rover SUSE / openSUSE 2 11-08-2004 10:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:02 AM.

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