U  W[x @sBdZddlmZmZmZddgZGdddeZedddZdS)z Time zone utilities. )datetime timedeltatzinfoFixedOffsetTimeZoneUTCc@sJeZdZdZdddZeddZeddZd d Zd d Z d dZ dS)ra* 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. NcCs||_||_dS)a Construct a L{FixedOffsetTimeZone} with a fixed offset. @param offset: a delta representing the offset from UTC. @type offset: L{timedelta} @param name: A name to be given for this timezone. @type name: L{str} or L{None} N)offsetname)selfrrr :/usr/lib/python3/dist-packages/twisted/python/_tzhelper.py__init__s zFixedOffsetTimeZone.__init__cCsLd|||f}|dkr$| }| }n|dkr:td|f|t||d|S)am 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. @type hours: L{int} @param minutes: The number of minutes in the offset @type minutes: L{int} @return: A time zone with the given offset, and a name describing the offset. @rtype: L{FixedOffsetTimeZone} z %s%02i:%02i-+zInvalid sign for timezone %r)hoursminutes) ValueErrorr)clsZsignrrrr r r fromSignHoursMinutes+sz(FixedOffsetTimeZone.fromSignHoursMinutescCst|t|}||S)a Create a time zone with a fixed offset corresponding to a time stamp in the system's locally configured time zone. @param timeStamp: a time stamp @type timeStamp: L{int} @return: a time zone @rtype: L{FixedOffsetTimeZone} )r fromtimestampZutcfromtimestamp)rZ timeStamprr r r fromLocalTimeStampIs z&FixedOffsetTimeZone.fromLocalTimeStampcCs|jS)z9 Return this timezone's offset from UTC. )rr Zdtr r r utcoffset\szFixedOffsetTimeZone.utcoffsetcCstdS)z| Return a zero C{datetime.timedelta} for the daylight saving time offset, since there is never one. r)rrr r r dstcszFixedOffsetTimeZone.dstcCs&|jdk r|jStd|}|dS)z; Return a string describing this timezone. NrzUTC%z)rrrstrftimerr r r tznameks  zFixedOffsetTimeZone.tzname)N) __name__ __module__ __qualname____doc__r classmethodrrrrrr r r r rs   rN)rrrr__all__rrrr r r r s e