Java Day getDayStr(int i, String formatStr)

Here you can find the source of getDayStr(int i, String formatStr)

Description

get Day Str

License

Apache License

Declaration

public static String getDayStr(int i, String formatStr) 

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 getDayStr(int i, String formatStr) {
        GregorianCalendar gc = (GregorianCalendar) Calendar.getInstance();
        gc.setTime(new Date());
        gc.add(Calendar.DATE, i);
        SimpleDateFormat formatter = new SimpleDateFormat(formatStr);
        String dateString = formatter.format(gc.getTime());
        return dateString;
    }/*from w w w . j  a v a2 s  .  com*/
}

Related

  1. getDaysFrom2Dates(Calendar calendar1, Calendar calendar2)
  2. getDaysLater(int day)
  3. getDaysMonthYear(Date date)
  4. getDaysOfDates(Date first, Date second)
  5. getdaysslice(String startdate, String enddate)
  6. getDayStringOfDate(Date date)
  7. getDayText(Date day)
  8. getDayTime_End()
  9. getLastDay()