code: public static String getUpTime() {
          long diff = ManagementFactory.getRuntimeMXBean().getUptime();
          diff /= 1000 * 60;
          long minutes = diff % 60;
          diff /= 60;
          long hours = diff % 24;
          diff /= 24;
          long days = diff;
          StringBuilder buf = new StringBuilder();
          if (days == 1) {
              buf.append("1 day ");
          } else if (days > 1) {
              buf.append(Long.valueOf(days).toString()).append(" days ");
          }
          DecimalFormat format = new DecimalFormat();
          format.setMinimumIntegerDigits(2);
          buf.append(format.format(hours)).append(":")
                  .append(format.format(minutes));
          return buf.toString();
      }
docs: Output the amount of time that has elapsed since the given date in the
  format x days, xx:xx.
  
  @return A string representing the formatted interval.