def format_timezone(offset, unnecessary_negative_timezone=False):
 if ((offset % 60) != 0):
  raise ValueError('Unable to handle non-minute offset.')
 if ((offset < 0) or unnecessary_negative_timezone):
  sign = '-'
  offset = (- offset)
 else:
  sign = '+'
 return ('%c%02d%02d' % (sign, (offset / 3600), ((offset / 60) % 60))).encode('ascii')

def format_timezone ( offset , unnecessary_negative_timezone = False ) : if ( ( offset % 60 ) != 0 ) : raise ValueError ( 'Unable to handle non-minute offset.' ) if ( ( offset < 0 ) or unnecessary_negative_timezone ) : sign = '-' offset = ( - offset ) else : sign = '+' return ( '%c%02d%02d' % ( sign , ( offset / 3600 ) , ( ( offset / 60 ) % 60 ) ) ) . encode ( 'ascii' )
format a timezone for git serialization .