public function getFormattedOffsetById($id)
    {
        switch ($id) {
            case self::DF_ISO_8601_BASIC:
            case self::DF_ISO_8601_EXTENDED:
            case self::DF_RFC_2822:
                $offset = $this->getOffset();
                $offset = intval(floor($offset / 60)); // minutes

                if ($offset === 0) {
                    $offset = 'Z';
                } else {
                    $offset_hours = floor($offset / 60);
                    $offset_minutes = abs($offset % 60);

                    $offset = sprintf(
                        '%+03.0d:%02.0d',
                        $offset_hours,
                        $offset_minutes
                    );
                }

                return $offset;
            default:
                throw new Exception("Unknown offset format for id '$id'.");
        }
    }