Change server time


#1

when I do something like this

$now = date('Y-m-d H:i:s');
echo($now);

The time is behind an hour from my local time. Is there a way to change the setting of the host server so that it shows my local time and not server’s time without having to add an “addHour” function to my code. Why I ask is because I’m making a basic punch card site for punching in and out of work.

thanks for the reply,
Throdne


#2

If you need your application to run in a time zone other than the system default (US/Pacific), you can do so using this function call:

(Or whatever the appropriate time zone is. I’m guessing here.)


#3

Thanks!!! Worked perfectly!