Android Date Today Get today()

Here you can find the source of today()

Description

today

Declaration

public static Date today() 

Method Source Code

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

public class Main {
    public static Date today() {
        return resetTime(new Date());
    }/*ww w . j  a va  2 s . c o m*/

    public static Date resetTime(Date date) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(date);
        cal.set(Calendar.HOUR_OF_DAY, 0);
        cal.set(Calendar.MINUTE, 0);
        cal.set(Calendar.SECOND, 0);
        cal.set(Calendar.MILLISECOND, 0);
        return cal.getTime();
    }
}

Related

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