Ejemplo n.º 1
0
     * Checks if this offset is equal to another offset.
     * <p>
     * The comparison is based on the amount of the offset in seconds.
     * This is equivalent to a comparison by ID.
     *
     * @param mixed $obj the object to check, null returns false
     * @return bool true if this is equal to the other offset
     */
    public function equals($obj)
    {
        if ($this === $obj) {
            return true;
        }
        if ($obj instanceof ZoneOffset) {
            return $this->totalSeconds == $obj->totalSeconds;
        }
        return false;
    }
    //-----------------------------------------------------------------------
    /**
     * Outputs this offset as a {@code String}, using the normalized ID.
     *
     * @return string a string representation of this offset, not null
     */
    public function __toString()
    {
        return $this->id;
    }
}
ZoneOffset::init();