Android Date Today Get todayWithHour()

Here you can find the source of todayWithHour()

Description

today With Hour

Declaration

public static Date todayWithHour() 

Method Source Code

//package com.java2s;
import java.util.Calendar;
import java.util.Date;

public class Main {
    public static Date todayWithHour() {
        Calendar cal = Calendar.getInstance();
        cal.setTime(new Date());
        int hour = cal.get(Calendar.HOUR_OF_DAY) + 1;
        cal.set(Calendar.HOUR_OF_DAY, hour);
        cal.set(Calendar.MINUTE, 0);
        cal.set(Calendar.SECOND, 0);
        cal.set(Calendar.MILLISECOND, 0);
        return cal.getTime();
    }/* w  w w .  j a va2s.com*/
}

Related

  1. getToday()
  2. getTodayDateString()
  3. getTodayEndTime()
  4. getTodayStartTime()
  5. today()
  6. getDate()
  7. getCurrentDate()
  8. getNowDate()