Java Today getTodayLimit()

Here you can find the source of getTodayLimit()

Description

get Today Limit

License

Apache License

Declaration

public static Date getTodayLimit() 

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 getTodayLimit() {
        return getDateEndTime(new Date());
    }//from  ww w. j  av  a  2 s.  c om

    public static Date getDateEndTime(Date date) {
        if (date == null)
            return null;
        Calendar c = Calendar.getInstance();
        c.setTime(date);
        c.add(Calendar.DAY_OF_MONTH, 1);
        setCalendarToZero(c);
        return c.getTime();
    }

    /**
     * 
     * @param c
     * @return
     */
    public static void setCalendarToZero(Calendar c) {
        c.set(Calendar.HOUR_OF_DAY, 0);
        c.set(Calendar.MINUTE, 0);
        c.set(Calendar.SECOND, 0);
        c.set(Calendar.MILLISECOND, 0);
    }
}

Related

  1. getTodayIntevalDays(String date)
  2. getTodayLast()
  3. getTodayLastSecond()
  4. getTodayLastSecond()
  5. getTodayLastUpdateTimeFormat()
  6. getTodayMidnight()
  7. getTodayMin()
  8. getTodayNight()
  9. getTodaysDate()