views:

34

answers:

1

Hi all. I have this question.

I am using php, mysql and my files will be hosted on linux machine.

Is it possible to change the date on a different format. I mean the date should change if it is 5PM. That is if today is 28th august 2010, then after 5pm it should show 29th august 2010.

Thanks a lot.

+1  A: 

Sounds like you simply want to add 7 hours to current time?

$corrected=time() + 3600*7;
echo strftime("%d %B %Y", $corrected);

If you want to do this for all your code, take a look at the PHP time zone configuration and date_default_timezone_set()

If you want to set your timezone on a server-wide basis, you'll probably find plenty of answers on ServerFault.com, such as Setting time zone on Linux (ubuntu)

See also

Paul Dixon
Thanks paul. Actually it is required because i am using arabic time and the day changes after 7PM
noobcode