Java TimeZone startOfNextDay(final Date date, final TimeZone timeZone)

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

Description

start Of Next Day

License

Open Source License

Declaration

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

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Calendar;

import java.util.Date;

import java.util.TimeZone;

public class Main {
    public static Date startOfNextDay(final Date date, final TimeZone timeZone) {
        final Calendar cal = Calendar.getInstance(timeZone);
        cal.setTime(date);//from  w ww  .  j av a  2s.c  o  m
        cal.add(Calendar.DATE, 1);

        cal.set(Calendar.HOUR, 0);
        cal.set(Calendar.MINUTE, 0);
        cal.set(Calendar.SECOND, 1);

        return cal.getTime();
    }
}

Related

  1. getTimezoneOffsetInHours(Date date)
  2. hasTimeComponent(Date date, TimeZone timeZone)
  3. midnight(Date date, TimeZone tz)
  4. monthOfYear(Date referenceDate, int month, TimeZone timeZone)
  5. normalizeDate(Date date, TimeZone timeZone)
  6. startOfYear(Date referenceDate, TimeZone timeZone)
  7. toEpoch(Date dateTime, String timeZone)