Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter jss

    (@jss)

    I found the solution: https://pl2.php.net/manual/pl/function.date-default-timezone-set.php

    Just add this code in wpf.class.php after first<?php:

    date_default_timezone_set('America/Los_Angeles');
    
    $script_tz = date_default_timezone_get();
    
    if (strcmp($script_tz, ini_get('date.timezone'))){
        echo 'Script timezone differs from ini-set timezone.';
    } else {
        echo 'Script timezone and ini-set timezone match.';
    }

    of course change America/Los_Angeles for your own continent and capital of your country. you can found approwed list of continents and capitals at php.net

    Thanks a million! I learned about this problem about a week ago, but luckily did not have time to start looking for a solution until now. Yours seems to work perfectly.

    Hmm, except for… why would I want to explicitly echo whether the two timezones differ or match? Somehow it manages to break my layout in IE.

    jss, thanks for the fix. It’s great!

    Just to clarify though, most of it is unnecessary.
    All you need is the first line:

    date_default_timezone_set('America/Los_Angeles');

    Just paste that in wpf.class.php after the first <?php and that will work.

    You don’t need the

    $script_tz = date_default_timezone_get();
    
    if (strcmp($script_tz, ini_get('date.timezone'))){
        echo 'Script timezone differs from ini-set timezone.';
    } else {
        echo 'Script timezone and ini-set timezone match.';
    }
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Forum server] how to change timezone’ is closed to new replies.