system/classes/timezoneconfig.class.php
branchHEAD
changeset 7432 3125f1336c8c
parent 7431 ecdf072e268e
child 7444 252d8d24012d
     1.1 --- a/system/classes/timezoneconfig.class.php	Sun Sep 20 17:06:57 2009 +0200
     1.2 +++ b/system/classes/timezoneconfig.class.php	Sun Sep 20 19:07:20 2009 +0200
     1.3 @@ -85,6 +85,28 @@
     1.4      }
     1.5  
     1.6      /**
     1.7 +    * Set the user's preferred timezone
     1.8 +    *
     1.9 +    * Note that does nothing if $_CONF['timezone'] is empty, i.e. if no
    1.10 +    * system timezone is defined, we don't set a user timezone either.
    1.11 +    *
    1.12 +    * @return void
    1.13 +    * @static
    1.14 +    *
    1.15 +    */
    1.16 +    function setUserTimeZone()
    1.17 +    {
    1.18 +        global $_CONF;
    1.19 +
    1.20 +        if (! empty($_CONF['timezone'])) {
    1.21 +            $tz = TimeZoneConfig::getUserTimeZone();
    1.22 +            if (! empty($tz)) {
    1.23 +                TimeZoneConfig::setSystemTimeZone($tz);
    1.24 +            }
    1.25 +        }
    1.26 +    }
    1.27 +
    1.28 +    /**
    1.29      * Get the user's preferred timezone
    1.30      *
    1.31      * @return   string  name of the timezone