def format_datetime(time_obj):
 timestamp = time_obj.isoformat('T')
 if (time_obj.tzinfo == tzutc()):
  timestamp = timestamp[:(-6)]
  return ('%sZ' % timestamp)
 return timestamp

def format_datetime ( time_obj ) : timestamp = time_obj . isoformat ( 'T' ) if ( time_obj . tzinfo == tzutc ( ) ) : timestamp = timestamp [ : ( - 6 ) ] return ( '%sZ' % timestamp ) return timestamp
see :meth:i18n .