File: //lib/python3/dist-packages/twisted/python/__pycache__/_tzhelper.cpython-312.pyc
�
�b8 � �l � d Z ddlmZmZmZ ddlmZ ddgZ G d� de� Z
e
j ddd� Zy) z
Time zone utilities.
� )�datetime� timedelta�tzinfo)�Optional�FixedOffsetTimeZone�UTCc � � e Zd ZdZddedee ddfd�Zedede d e dd fd
�� Z
ededd fd�� Zd
ee
defd�Zd
ee
defd�Zd
ee
defd�Zy)r a*
Represents a fixed timezone offset (without daylight saving time).
@ivar name: A L{str} giving the name of this timezone; the name just
includes how much time this offset represents.
@ivar offset: A L{TimeDelta} giving the amount of time this timezone is
offset.
N�offset�name�returnc � � || _ || _ y)z�
Construct a L{FixedOffsetTimeZone} with a fixed offset.
@param offset: a delta representing the offset from UTC.
@param name: A name to be given for this timezone.
N)r
r )�selfr
r s �:/usr/lib/python3/dist-packages/twisted/python/_tzhelper.py�__init__zFixedOffsetTimeZone.__init__ s � � ����� � �sign�hours�minutesc �x � d|||fz }|dk( r| }| }n|dk7 rt d|��� � | t ||�� |� S )a
Construct a L{FixedOffsetTimeZone} from an offset described by sign
('+' or '-'), hours, and minutes.
@note: For protocol compatibility with AMP, this method never uses 'Z'
@param sign: A string describing the positive or negative-ness of the
offset.
@param hours: The number of hours in the offset.
@param minutes: The number of minutes in the offset
@return: A time zone with the given offset, and a name describing the
offset.
z%s%02i:%02i�-�+zInvalid sign for timezone )r r )�
ValueError� TimeDelta)�clsr r r r s r �fromSignHoursMinutesz(FixedOffsetTimeZone.fromSignHoursMinutes'