daylight saving time problem

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

    daylight saving time problem

    I've manually updated the timezone to reflect the new DST for the
    entire server network I'm working on. Almost everything is working
    correctly, except PHP's date/time functions still return dates as
    though DST will occur at 2:00am on April 2, 2007. This only happens
    when the script is executed through an http request:

    <?php
    echo date("F d, Y H:i:s", time()) . "\n" ;
    ?>

    on shell:
    [user]$ php test.php
    March 12, 2007 11:55:51
    (correct)

    on web browser:
    March 12, 2007 10:55:11
    (incorrect)

    What's the problem here?

  • Colin McKinnon

    #2
    Re: daylight saving time problem

    Tom wrote:

    on shell:
    [user]$ php test.php
    March 12, 2007 11:55:51
    (correct)
    >
    on web browser:
    March 12, 2007 10:55:11
    (incorrect)
    >
    What's the problem here?
    You're probably running as different users, running different binaries, with
    different environments.

    If its critical to fix it, then start with the env settings and work
    forwards from there.

    C.

    Comment

    • Gordon Burditt

      #3
      Re: daylight saving time problem

      >I've manually updated the timezone to reflect the new DST for the
      >entire server network I'm working on. Almost everything is working
      >correctly, except PHP's date/time functions still return dates as
      >though DST will occur at 2:00am on April 2, 2007.
      Did you restart the web server after you did the OS patches?
      Processes like Apache (and cron) may suck in the timezone rules or
      value of $TZ or whatever once on startup, and keep the same rules
      until the process is restarted.


      Comment

      Working...