PHP time

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jade756
Forum Newbie
Posts: 4
Joined: Fri May 22, 2009 5:21 am

PHP time

Post by jade756 »

hello :D

I used the date('H') php function..
however, its output is 9 instead of 17 (since its 5 pm here)

can you suggest a better function to get the correct system time?
thanks in advance :D
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: PHP time

Post by Mark Baker »

Either your server clock is very, very wrong, or it's in a different timezone.

Assuming it's timezone, then use:

Code: Select all

 
date_default_timezone_set('Europe/London');
 
Post Reply