Java Today getTodayLast()

Here you can find the source of getTodayLast()

Description

get Today Last

License

Apache License

Declaration

public static Date getTodayLast() 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Calendar;
import java.util.Date;

public class Main {
    public static Date getTodayLast() {
        Calendar cal = Calendar.getInstance();
        cal.setTime(getTodayZero());//w w  w.j a  v  a 2  s  . c  om
        cal.add(Calendar.DAY_OF_MONTH, 1);
        cal.add(Calendar.MILLISECOND, -1);
        return cal.getTime();
    }

    public static Date getTodayZero() {
        Calendar cal = Calendar.getInstance();
        cal.setTime(new 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. getTodayFormatString(String pattern)
  2. getTodayFormatted(String pattern)
  3. getTodayHHmmss(String HHmmss)
  4. getTodayInFormat(String format)
  5. getTodayIntevalDays(String date)
  6. getTodayLastSecond()
  7. getTodayLastSecond()
  8. getTodayLastUpdateTimeFormat()
  9. getTodayLimit()