original_string: public function HourOffset() {
        static $GuestHourOffset;
        
        if ($this->UserID > 0) {
           return $this->User->HourOffset;
        } else {
           if (!isset($GuestHourOffset)) {
              $GuestTimeZone = C('Garden.GuestTimeZone');
              if ($GuestTimeZone) {
                 try {
                    $TimeZone = new DateTimeZone($GuestTimeZone);
                    $Offset = $TimeZone->getOffset(new DateTime('now', new DateTimeZone('UTC')));
                    $GuestHourOffset = floor($Offset / 3600);
                 } catch (Exception $Ex) {
                    $GuestHourOffset = 0;
                    LogException($Ex);
                 }
              }
           }
           
           return $GuestHourOffset;
        }
     }
code: public function HourOffset() {
        static $GuestHourOffset;
        
        if ($this->UserID > 0) {
           return $this->User->HourOffset;
        } else {
           if (!isset($GuestHourOffset)) {
              $GuestTimeZone = C('Garden.GuestTimeZone');
              if ($GuestTimeZone) {
                 try {
                    $TimeZone = new DateTimeZone($GuestTimeZone);
                    $Offset = $TimeZone->getOffset(new DateTime('now', new DateTimeZone('UTC')));
                    $GuestHourOffset = floor($Offset / 3600);
                 } catch (Exception $Ex) {
                    $GuestHourOffset = 0;
                    LogException($Ex);
                 }
              }
           }
           
           return $GuestHourOffset;
        }
     }
code_tokens: public function HourOffset ( ) { static $ GuestHourOffset ; if ( $ this -> UserID > 0 ) { return $ this -> User -> HourOffset ; } else { if ( ! isset ( $ GuestHourOffset ) ) { $ GuestTimeZone = C ( 'Garden.GuestTimeZone' ) ; if ( $ GuestTimeZone ) { try { $ TimeZone = new DateTimeZone ( $ GuestTimeZone ) ; $ Offset = $ TimeZone -> getOffset ( new DateTime ( 'now' , new DateTimeZone ( 'UTC' ) ) ) ; $ GuestHourOffset = floor ( $ Offset / 3600 ) ; } catch ( Exception $ Ex ) { $ GuestHourOffset = 0 ; LogException ( $ Ex ) ; } } } return $ GuestHourOffset ; } }
docstring: Return the timezone hour difference between the user and utc.
  @return int The hour offset.
docstring_tokens: Return the timezone hour difference between the user and utc .