Android Date Format getFormatTomorrow(String format)

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

Description

get Format Tomorrow

License

Apache License

Declaration

public static String getFormatTomorrow(String format) 

Method Source Code

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

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   w  w w  . j  ava2 s  .co  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. format(Date date)
  2. format(Date date, String pattern)
  3. formatData(Date date)
  4. formatDate(final Date date)
  5. getStringFromDate(Date date, String format)
  6. getDisplayDate(Date date, String format)
  7. getFormatedDate(Date date, String format)
  8. dateFormat(String sdate, String format)
  9. dateFormat(String sdate, String format)