code: public static long getDayEndTime(final long time) {
          final Calendar end = Calendar.getInstance();
          end.setTimeInMillis(time);
          final int year = end.get(Calendar.YEAR);
          final int month = end.get(Calendar.MONTH);
          final int day = end.get(Calendar.DATE);
          end.set(year, month, day, 23, 59, 59);
          end.set(Calendar.MILLISECOND, 999);
  
          return end.getTimeInMillis();
      }
docs: Gets the day end time with the specified time.
  
  @param time the specified time
  @return day end time