Java Day End getEndOfDay(final Date date, final TimeZone timeZone)

Here you can find the source of getEndOfDay(final Date date, final TimeZone timeZone)

Description

get End Of Day

License

Open Source License

Declaration

public static Date getEndOfDay(final Date date, final TimeZone timeZone) 

Method Source Code

//package com.java2s;
// ProjectForge is dual-licensed.

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

public class Main {
    public static Date getEndOfDay(final Date date, final TimeZone timeZone) {
        final Calendar cal = Calendar.getInstance(timeZone);
        cal.setTime(date);//  w  w  w.  j  a v a 2s.  com
        cal.set(Calendar.HOUR_OF_DAY, 23);
        cal.set(Calendar.MINUTE, 59);
        cal.set(Calendar.SECOND, 59);
        cal.set(Calendar.MILLISECOND, 999);
        return cal.getTime();
    }
}

Related

  1. getEndOfDay(Date date)
  2. getEndOfDay(Date date)
  3. getEndOfDay(Date day)
  4. getEndOfDay(Date day)
  5. getEndOfDay(Date when)
  6. getEndOfDay(Long date)
  7. getEndOfHour(Date day)
  8. getEndOfTheDate(Date date)
  9. getEndOfYear(Date dt)