Java Hour Calculate getTomorrowSixHours()

Here you can find the source of getTomorrowSixHours()

Description

get Tomorrow Six Hours

License

Apache License

Return

Date

Declaration

public static Date getTomorrowSixHours() 

Method Source Code

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

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class Main {
    private static SimpleDateFormat dayFormater = new SimpleDateFormat("yyyy-MM-dd");

    public static Date getTomorrowSixHours() {
        Calendar c = Calendar.getInstance();
        c.add(Calendar.DAY_OF_YEAR, 1);
        c.add(Calendar.HOUR_OF_DAY, 6);
        Date date = c.getTime();//from  www  . j  a  va2  s  .co  m
        String t = dayFormater.format(date);
        try {
            date = dayFormater.parse(t);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return date;
    }
}

Related

  1. getDoubleValue(String hours)
  2. getExpiresDate(int hours)
  3. getTime(String dateStr, int hour, String timeZone)
  4. getTimestampFromDateHour2(String d)
  5. getTimeStringOfHourBefore(int hour)
  6. getWeeHours()
  7. hoursMinsSecsFromMs(long ms)
  8. isHourMinute(String str)
  9. isValidTime(int hour, int minute, boolean ampm)