Android Date Format getFormatTomorrow(String format)

Here you can find the source of getFormatTomorrow(String format)

Description

get Format Tomorrow

Declaration

public static String getFormatTomorrow(String format) 

Method Source Code

//package com.java2s;

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

public class Main {
    public static String getFormatTomorrow(String format) {
        return getFormatCurrentAdd(1, format);
    }/*from   ww w  .j av a2  s  . c  o m*/

    public static String getFormatCurrentAdd(int amount, String format) {

        Date d = getDateAdd(new Date(), amount);

        return getFormatDateTime(d, format);
    }

    public static Date getDateAdd(Date date, int amount) {
        Calendar cal = new GregorianCalendar();
        cal.setTime(date);
        cal.add(GregorianCalendar.DATE, amount);
        return cal.getTime();
    }

    public static String getFormatDateTime(Date date, String format) {
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(date);
    }
}

Related

  1. getFormatDateTime(Date date, String format)
  2. getFormatDateTommorrow(String sourceDate, String format)
  3. getFormatDateTommorrow(String sourceDate, String format)
  4. getFormatShortTime(Date date)
  5. getFormatTime(Date date)
  6. getFormatYestoday(String format)
  7. getUniversalDateStamp(Date date)
  8. getUtcTimeStringFromDate(Date date)
  9. timestampToISO8601(Date aDate)