(self, dt)
return dt + dtdst
datetime in UTC -> datetime in local time.
datetime in UTC -> datetime in local time.
datetime in UTC - > datetime in local time .
def fromutc(self, dt):
        "datetime in UTC -> datetime in local time."

        if not isinstance(dt, datetime):
            raise TypeError("fromutc() requires a datetime argument")
        if dt.tzinfo is not self:
            raise ValueError("dt.tzinfo is not self")

        dtoff = dt.utcoffset()
        if dtoff is None:
            raise ValueError("fromutc() requires a non-None utcoffset() "
                             "result")

        # See the long comment block at the end of this file for an
        # explanation of this algorithm.
        dtdst = dt.dst()
        if dtdst is None:
            raise ValueError("fromutc() requires a non-None dst() result")
        delta = dtoff - dtdst
        if delta:
            dt += delta
            dtdst = dt.dst()
            if dtdst is None:
                raise ValueError("fromutc(): dt.dst gave inconsistent "
                                 "results; cannot convert")
        return dt + dtdst
def fromutc ( self , dt ) : if not isinstance ( dt , datetime ) : raise TypeError ( "fromutc() requires a datetime argument" ) if dt . tzinfo is not self : raise ValueError ( "dt.tzinfo is not self" ) dtoff = dt . utcoffset ( ) if dtoff is None : raise ValueError ( "fromutc() requires a non-None utcoffset() " "result" ) # See the long comment block at the end of this file for an # explanation of this algorithm. dtdst = dt . dst ( ) if dtdst is None : raise ValueError ( "fromutc() requires a non-None dst() result" ) delta = dtoff - dtdst if delta : dt += delta dtdst = dt . dst ( ) if dtdst is None : raise ValueError ( "fromutc(): dt.dst gave inconsistent " "results; cannot convert" ) return dt + dtdst