Returns the given time formatted as a number of days, hours and minutes.
@param dt The time to be parsed
@return The given time formatted as a number of days, hours and minutes
180641
static public String getLongFormattedDays(long dt)
    {
        StringBuffer ret = new StringBuffer();

        long days = dt/86400000L;
        long millis = dt-(days*86400000L);
        if(days > 0)
        {
            ret.append(Long.toString(days));
            ret.append(" day");
            if(days > 1)
                ret.append("s");
        }

        long hours = millis/3600000L;
        millis = millis-(hours*3600000L);

        if(hours > 0)
        {
            if(ret.length() > 0)
                ret.append(" ");
            ret.append(Long.toString(hours));
            ret.append(" hour");
            if(hours > 1)
                ret.append("s");
        }

        long minutes = millis/60000L;
        millis = millis-(minutes*60000L);

        if(minutes > 0)
        {
            if(ret.length() > 0)
                ret.append(" ");
            ret.append(Long.toString(minutes));
            ret.append(" minute");
            if(minutes > 1)
                ret.append("s");
        }

        long seconds = millis/1000L;
        if(seconds > 0)
        {
            if(ret.length() > 0)
                ret.append(" ");
            ret.append(Long.toString(seconds));
            ret.append(" second");
            if(seconds > 1)
                ret.append("s");
        }

        return ret.toString();
    }
368186
def to_minutes(days=0, hours=0, minutes=0, seconds=0, milliseconds=0,
               round_to_int=True):
    
    total = float(days)*24*60 + float(hours)*60 + float(minutes) + \
        float(seconds)/60 + float(milliseconds)/1000/60
    return int(round(total)) if round_to_int else total
547683
public static Date getDateWithPrevDays(int noOfDays) throws ParseException {
        Calendar currentDate = Calendar.getInstance();
        currentDate.add(Calendar.DATE, -noOfDays);
        SimpleDateFormat formatter = new SimpleDateFormat(DATE_yyyyMMddTHHmmssSSSZ);
        String dateNow = formatter.format(currentDate.getTime());
        return getDateFromString(dateNow);
    }
167562
private static String formatTime(long ms)
    {
        StringTokenizer st = new StringTokenizer(new Date(ms).toString());
        ArrayList<String>	arrayList = new ArrayList<>();
        while (st.hasMoreTokens())
            arrayList.add(st.nextToken());

        String  time  = arrayList.get(3);
        double d = (double)ms/1000;
        long   l = ms/1000;
        d = (d - l) * 1000;
        ms = (long) d;

        return time + "." + ms;
    }
412329
public static String format36time(long time) {
        String time36 = Long.toString(time, 36);
        return time36.length() < 9 ? ("0" + time36) : time36;
    }
647884
public static String formatDateDifference(Date d1, Date d2) {
		long[] td = DateHelper.getTimeDifference(d1, d2);
		if (td[0] > 0) {
			return td[0] + " day(s), " + td[1] + " hour(s)";
		}
		if (td[1] > 0) {
			return td[1] + " hour(s), " + td[2] + " minute(s)";
		}
		if (td[2] > 0) {
			return td[2] + " minute(s), " + td[3] + " second(s)";
		}
		return td[3] + " second(s)";
	}
130755
public int days() {
        if (isInfinite()) {
            return 0;
        }
        Period p = new Period(asInterval(), PeriodType.days());
        return p.getDays();
    }
934348
public static Date getWeekDay(Date dt, int weekDay) {
        Calendar cal = new GregorianCalendar();
        cal.setTime(dt);
        if (weekDay == 7) {
            weekDay = 1;
        } else {
            weekDay++;
        }
        cal.set(GregorianCalendar.DAY_OF_WEEK, weekDay);
        return cal.getTime();
    }
57463
public static Date getNextDay(Date dt) {

        if (dt == null) {
            return dt;
        }

        Calendar cal = new GregorianCalendar();
        cal.setTime(dt);

        // return new GregorianCalendar(cal.get(Calendar.YEAR), cal
        // .get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH) + 1) //这个方法会出现
        // 32 号的情况
        // .getTime();
        //

        // modified by zhuqian 2009-03-25
        cal.add(Calendar.DAY_OF_YEAR, 1);
        return cal.getTime();

    }
182776
private Date getTimeFromInteger(Integer time)
   {
      Date result = null;

      if (time != null)
      {
         int minutes = time.intValue();
         int hours = minutes / 60;
         minutes -= (hours * 60);

         Calendar cal = DateHelper.popCalendar();
         cal.set(Calendar.MILLISECOND, 0);
         cal.set(Calendar.SECOND, 0);
         cal.set(Calendar.MINUTE, minutes);
         cal.set(Calendar.HOUR_OF_DAY, hours);
         result = cal.getTime();
         DateHelper.pushCalendar(cal);
      }

      return (result);
   }
129247
public static DateTimeFormatter getDateTimeFormatter(String timeFormat) {
        return JMMap
                .getOrPutGetNew(dateTimeFormatterCache, timeFormat,
                        () -> DateTimeFormatter.ofPattern(timeFormat));
    }
345217
private long parseTime(String day, String hours)
    {
        DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
        Date utcDate = new Date();
        try {
            utcDate = format.parse(day.concat(" " + hours));
        } catch (Exception e) {

        }
        return utcDate.getTime();
    }
661050
@Nullable
  public Date getTimeOfDayForDate (final Date dateTime)
  {
    if (dateTime == null)
      return null;
    final Calendar cal = PDTFactory.createCalendar ();
    cal.setTime (dateTime);
    cal.set (Calendar.HOUR_OF_DAY, m_nHour);
    cal.set (Calendar.MINUTE, m_nMinute);
    cal.set (Calendar.SECOND, m_nSecond);
    cal.clear (Calendar.MILLISECOND);
    return cal.getTime ();
  }
501443
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();
    }
156032
static public String getFormattedDateTime(long dt, TimeZone tz, String format)
    {
        SimpleDateFormat df = new SimpleDateFormat(format);
        if(tz != null)
            df.setTimeZone(tz);
        return df.format(new Date(dt));
    }
851404
public D plus(CalendarDays days) {

        long result = Math.addExact(this.getDaysSinceEpochUTC(), days.getAmount());

        try {
            return this.getChronology().getCalendarSystem().transform(result);
        } catch (IllegalArgumentException iae) {
            ArithmeticException ex = new ArithmeticException("Out of range: " + result);
            ex.initCause(iae);
            throw ex;
        }

    }
567245
public static Date getNextDay(Date dt, Long n) {

        Calendar cal = new GregorianCalendar();
        cal.setTime(dt);

        return new GregorianCalendar(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH),
                                        cal.get(Calendar.DAY_OF_MONTH) + n.intValue()).getTime();

    }