Posted by ZeldorBlat on 08/21/06 20:48
John wrote:
> Is it possible to have some .php file run on my host so that I can
> display PST and not the servers EST when a php script is run. I don't
> want to find the code on all of my scripts and make adjustments.
>
>
> I know the command:
>
>
> $currentTime=time()-(3*60*60);
>
>
>
> But not sure what script to use it on. Do I use it on the one
> displaing the time?
time() returns a timestamp, which is always in UTC. What you really
want to do is call date_default_timezone_set() before calling date()
when you display the time. No other adjustments are necessary.
Navigation:
[Reply to this message]
|