Пример #1
0
  public static long GetMillisecondsOfDay(int hour, int minute, int second) {
    Calendar calendar = Calendar.getInstance();

    while (minute > 60) {
      minute -= 60;
      hour++;
    }

    hour = hour % 24;

    calendar.set(Calendar.HOUR_OF_DAY, hour);
    calendar.set(Calendar.MINUTE, minute);
    calendar.set(Calendar.SECOND, second);
    calendar.set(Calendar.MILLISECOND, 0);

    return calendar.getTimeInMillis() - Util.GetMillisecondsOfDay();
  }
Пример #2
0
  public static String GetPrintableTimeOfDay(long timeOfDay) {
    Date date = new Date(Util.GetMillisecondsOfDay() + timeOfDay);

    return GetTimeOfDatePrintableFormat(date);
  }