Java Day of lastDays(int count)

Here you can find the source of lastDays(int count)

Description

last Days

License

Apache License

Declaration

public static List<String> lastDays(int count) 

Method Source Code

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

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;

import java.util.List;

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

    public static List<String> lastDays(int count) {
        List<String> strings = new ArrayList<String>();
        Calendar day = Calendar.getInstance();
        for (int i = 0; i < count; i++) {
            day.add(Calendar.DATE, -1);
            strings.add(df.format(day.getTime()));
        }/*  ww w.ja v a  2 s.  c  o  m*/
        return strings;
    }
}

Related

  1. isHoliday(Date date, String[] excludes, String[] includes)
  2. isIn(int reserveDayCount, String dateString)
  3. isInAllDayFormat(String date)
  4. isNowDay(String d)
  5. isSomeDay(String date)
  6. long2StringPerDay(long t, SimpleDateFormat sdf)
  7. minDayToLong(String time)
  8. minusDate(int day, int type)
  9. nextDay(Date date)