
    tfw                         d Z ddlmZmZmZmZ ddlm	Z	 ddgZ
 G d de          Ze                    ddd          ZdS )	z
Time zone utilities.
    )datetime	timedeltatimezonetzinfo)OptionalFixedOffsetTimeZoneUTCc            	           e Zd ZdZddedee         ddfdZedede	d	e	dd fd
            Z
ededd fd            Zdee         defdZdee         defdZdee         defdZdS )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                 "    || _         || _        dS )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      W/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/twisted/python/_tzhelper.py__init__zFixedOffsetTimeZone.__init__"   s     			    signhoursminutesc                     d|||fz  }|dk    r| }| }n|dk    rt          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-+zInvalid sign for timezone )r   r   )
ValueError	TimeDelta)clsr   r   r   r   s        r   fromSignHoursMinutesz(FixedOffsetTimeZone.fromSignHoursMinutes,   sm    $ eW553;;FEhGGS[[B$BBCCCs95':::DAAAr   	timeStampc                     t          j        |          t          j        |t          j                                      d          z
  } | |          S )z
        Create a time zone with a fixed offset corresponding to a time stamp in
        the system's locally configured time zone.
        N)r   )DateTimefromtimestampr   utcreplace)r   r   r   s      r   fromLocalTimeStampz&FixedOffsetTimeZone.fromLocalTimeStampF   sN     '	22X5Kx|6
 6

''

 s6{{r   dtc                     | j         S )z>
        Return the given timezone's offset from UTC.
        )r   r   r$   s     r   	utcoffsetzFixedOffsetTimeZone.utcoffsetQ   s     {r   c                      t          d          S )zs
        Return a zero L{TimeDelta} for the daylight saving time
        offset, since there is never one.
        r   )r   r&   s     r   dstzFixedOffsetTimeZone.dstW   s    
 ||r   c                 r    | j         | j         S t          j        d|           }|                    d          S )z;
        Return a string describing this timezone.
        Nr   zUTC%z)r   r   r    strftimer&   s     r   tznamezFixedOffsetTimeZone.tzname^   s8     9 9#At,,{{7###r   )N)__name__
__module____qualname____doc__r   r   strr   classmethodintr   floatr#   r   r'   r)   r,    r   r   r   r      s<         y       BB"B-0B	B B B [B2 5 5J    [HX. 9    hx( Y    $(+ $ $ $ $ $ $ $r   r   N)r0   r   r   r   r   r   r   TZInfotypingr   __all__r   r   r	   r5   r   r   <module>r9      s   
                   	O$ O$ O$ O$ O$& O$ O$ O$d ..sAq99r   