def short_time_label(seconds):
 if (seconds < 0):
  raise ValueError(("Input needs to be a non-negative integer, got '%i'" % seconds))
 time_comp = {}
 for (amount, _, label) in TIME_UNITS:
  count = int((seconds / amount))
  seconds %= amount
  time_comp[label.strip()] = count
 label = ('%02i:%02i' % (time_comp['minute'], time_comp['second']))
 if time_comp['day']:
  label = ('%i-%02i:%s' % (time_comp['day'], time_comp['hour'], label))
 elif time_comp['hour']:
  label = ('%02i:%s' % (time_comp['hour'], label))
 return label

def short_time_label ( seconds ) : if ( seconds < 0 ) : raise ValueError ( ( "Input needs to be a non-negative integer, got '%i'" % seconds ) ) time_comp = { } for ( amount , _ , label ) in TIME_UNITS : count = int ( ( seconds / amount ) ) seconds %= amount time_comp [ label . strip ( ) ] = count label = ( '%02i:%02i' % ( time_comp [ 'minute' ] , time_comp [ 'second' ] ) ) if time_comp [ 'day' ] : label = ( '%i-%02i:%s' % ( time_comp [ 'day' ] , time_comp [ 'hour' ] , label ) ) elif time_comp [ 'hour' ] : label = ( '%02i:%s' % ( time_comp [ 'hour' ] , label ) ) return label
provides a time in the following format: [[dd-]hh:]mm:ss .