Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 4th June 2010, 14:12
Pashy Pashy is offline
Junior Member
 
Join Date: Jun 2010
Posts: 11
Thanks: 2
Thanked 0 Times in 0 Posts
Default 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 as output.
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.
Reply With Quote
Sponsored Links
  #2  
Old 5th June 2010, 12:52
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Does this still happen after a reboot?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
The Following User Says Thank You to falko For This Useful Post:
Pashy (7th June 2010)
  #3  
Old 5th June 2010, 16:05
Rapid2214 Rapid2214 is offline
Senior Member
 
Join Date: Jun 2010
Posts: 105
Thanks: 3
Thanked 5 Times in 5 Posts
Default

Looks like a daylight saving error, look in you php.ini
Reply With Quote
The Following User Says Thank You to Rapid2214 For This Useful Post:
Pashy (7th June 2010)
  #4  
Old 29th August 2012, 22:19
mgolra mgolra is offline
Junior Member
 
Join Date: Aug 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Current system time on PHP Webpage

@ Pashy & Falko
Hi!
try this code. it is working

<?php
$time_now=mktime(date('h')+3,date('i'),date('s'));

print "<br>".date('h:i:s',$time_now);
?>
Reply With Quote
  #5  
Old 30th August 2012, 10:23
todx todx is offline
Member
 
Join Date: Apr 2012
Posts: 77
Thanks: 33
Thanked 6 Times in 5 Posts
 
Default

I believe this issue has been resolved in 2 years.. no need to revoke old post xD
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can all the installation and configuration be automated (Kickstart) gabby Installation/Configuration 0 30th January 2010 19:47
Freebsd 6.1 support misterm Installation/Configuration 10 9th April 2009 09:29
Postfix - Relay access denied gotting Server Operation 3 23rd April 2008 14:06
ubuntu ispconfig joomla .htaccess steve1084 General 8 6th January 2007 15:55
PHP error chrno Installation/Configuration 2 7th September 2006 13:27


All times are GMT +2. The time now is 14:55.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.