Setting the environment variable for timezones ...

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

    Setting the environment variable for timezones ...

    So I can't figure out what exactly is going wrong here ... I'm using
    php4.3
    I'm accessing a server in Dublin from Seoul. I need to be able to
    translate times into various timezones across the world. Simple
    addition isn't the best because it doesn't take into account Daylight
    Saving Times etc ....

    What I'm doing is setting the TZ environment variable to my preferred
    timezone and then calling a date function to get the hour ...

    putenv("TZ=EST" );
    echo date('G');

    .... unfortunately it doesn't work and I don't know why.
    TZ is definitely set when I call my date function ... but it always
    returns dublin time regardless of the TZ environment variable .... ?

    Help ...

  • Sjoerd

    #2
    Re: Setting the environment variable for timezones ...


    dbee wrote:[color=blue]
    > putenv("TZ=EST" );
    > echo date('G');[/color]

    This works for me on PHP 4.3.4, 4.4.2 and 5.1.2 on Linux.

    Comment

    Working...