code: def _format_date(val, unit):
      
      if val==numpy.floor(val) and unit=='d':
          # Do not show time part if 0
          return quantity(val,unit).formatted('YMD_ONLY')
      else:
          return quantity(val,unit).formatted('DMY')
docs: Format dates.
      :param val: Value (just the value, not a quantity)
      :param unit: Unit. Should be 'rad' or 's'
      :return: A string representation of this date.
  
      >>> _format_date(4914741782.503475, 's')
      "14-Aug-2014/14:03:03"