PHP Time Question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John

    PHP Time Question

    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=ti me()-(3*60*60);



    But not sure what script to use it on. Do I use it on the one
    displaing the time?
  • ZeldorBlat

    #2
    Re: PHP Time Question


    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=ti me()-(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_ti mezone_set() before calling date()
    when you display the time. No other adjustments are necessary.

    Comment

    Working...