
    hw                     p    S r SSKJrJrJrJr  SSKJ	r	  SS/r
 " S S\5      r\R                  SSS5      rg)	z
Time zone utilities.
    )datetime	timedeltatimezonetzinfo)OptionalFixedOffsetTimeZoneUTCc            	           \ rS rSrSrSS\S\\   SS4S jjr\	S\S	\
S
\
SS 4S j5       r\	S\SS 4S j5       rS\\   S\4S jrS\\   S\4S jrS\\   S\4S jrSrg)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                     Xl         X l        g)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      _/root/1688_scrapy/alibaba-scraper/venv/lib/python3.13/site-packages/twisted/python/_tzhelper.py__init__FixedOffsetTimeZone.__init__"   s     	    signhoursminutesc                 t    SXU4-  nUS:X  a  U* nU* nOUS:w  a  [        SU< 35      eU " [        X#S9U5      $ )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   fromSignHoursMinutes(FixedOffsetTimeZone.fromSignHoursMinutes,   sT    $ W553;FEhGS[9$BCC95:DAAr   	timeStampc                     [         R                  " U5      [         R                  " U[        R                  5      R	                  SS9-
  nU " U5      $ )zt
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   fromLocalTimeStamp&FixedOffsetTimeZone.fromLocalTimeStampF   sG     ''	2X5K5Kx||6

''
 6{r   dtc                     U R                   $ )z.
Return the given timezone's offset from UTC.
)r   r   r(   s     r   	utcoffsetFixedOffsetTimeZone.utcoffsetQ   s     {{r   c                     [        S5      $ )z[
Return a zero L{TimeDelta} for the daylight saving time
offset, since there is never one.
r   )r   r*   s     r   dstFixedOffsetTimeZone.dstW   s    
 |r   c                     U R                   b  U R                   $ [        R                  " SU 5      nUR                  S5      $ )z+
Return a string describing this timezone.
r   zUTC%z)r   r"   r#   strftimer*   s     r   tznameFixedOffsetTimeZone.tzname^   s9     99 99##At,{{7##r   )r   r   )N)__name__
__module____qualname____firstlineno____doc__r   r   strr   classmethodintr   floatr&   r"   r+   r.   r2   __static_attributes__ r   r   r   r      s    y    BB"B-0B	B B2 5 5J  HX. 9 hx( Y $(+ $ $r   r   N)r8   r   r"   r   r   r   r   TZInfotypingr   __all__r   r   r	   r>   r   r   <module>rB      sM   
   	O$& O$d ..sAq9r   