Java Day End getEndOfDay(Long date)

Here you can find the source of getEndOfDay(Long date)

Description

get End Of Day

License

Apache License

Declaration

public static Long getEndOfDay(Long date) 

Method Source Code

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

import java.util.*;

public class Main {
    public static Long getEndOfDay(Long date) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTimeInMillis(date);/*from  ww w  . j  a  v a 2 s .  c om*/
        calendar.set(Calendar.HOUR_OF_DAY, 23);
        calendar.set(Calendar.MINUTE, 59);
        calendar.set(Calendar.SECOND, 59);
        calendar.set(Calendar.MILLISECOND, 999);
        return calendar.getTimeInMillis();
    }

    public static Date getEndOfDay(Date date) {
        long time = getEndOfDay(date.getTime());
        return new Date(time);
    }
}

Related

  1. getEndOfDay(Date date)
  2. getEndOfDay(Date day)
  3. getEndOfDay(Date day)
  4. getEndOfDay(Date when)
  5. getEndOfDay(final Date date, final TimeZone timeZone)
  6. getEndOfHour(Date day)
  7. getEndOfTheDate(Date date)
  8. getEndOfYear(Date dt)
  9. getEndQuaterly(Date startDate)