time problem

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
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

time problem

Post by itsmani1 »

I am having time problem with server.
When i tired following code it says:
09/09/2008 14:30:03

Code: Select all

$format = '%d/%m/%Y %H:%M:%S';
$strf = strftime($format);
 
But when i login to server it says:
Tue Sep 9 15:26:40 2008

why is this difference of one hour? any idea?

thank you
shaneiadt
Forum Newbie
Posts: 10
Joined: Sat Mar 15, 2008 9:26 pm

Re: time problem

Post by shaneiadt »

Maybe try using the date() function and see if it makes a difference;

Code: Select all

[size=150]echo date("H:i:s");  // will output 17:16:17[/size]
http://ie.php.net/date
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Re: time problem

Post by jayshields »

It's probably because your server timezone is different to the other servers timezone.
Post Reply