def get_fixed_timezone(offset):
 if isinstance(offset, timedelta):
  offset = (offset.seconds // 60)
 sign = ('-' if (offset < 0) else '+')
 hhmm = ('%02d%02d' % divmod(abs(offset), 60))
 name = (sign + hhmm)
 return FixedOffset(offset, name)

def get_fixed_timezone ( offset ) : if isinstance ( offset , timedelta ) : offset = ( offset . seconds // 60 ) sign = ( '-' if ( offset < 0 ) else '+' ) hhmm = ( '%02d%02d' % divmod ( abs ( offset ) , 60 ) ) name = ( sign + hhmm ) return FixedOffset ( offset , name )
returns a tzinfo instance with a fixed offset from utc .