Java Day of getSetDate(Date dt, int dayNum)

Here you can find the source of getSetDate(Date dt, int dayNum)

Description

get Set Date

License

Open Source License

Declaration

public static String getSetDate(Date dt, int dayNum) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * @FileName: helper.java 2013-7-12 ????4:13:15
 * @Author: zhangzhia/*from   w  ww.  j a va  2 s. com*/
 * @Copyright: 2013 YUTONG Group CLW. All rights reserved.
 * @Remarks: YUTONG PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 *******************************************************************************/

import java.text.SimpleDateFormat;

import java.util.Calendar;
import java.util.Date;

public class Main {
    public static String getSetDate(Date dt, int dayNum) {
        StringBuffer str = new StringBuffer();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        Calendar lastDate = Calendar.getInstance();
        lastDate.add(Calendar.DATE, dayNum);
        str.append(sdf.format(lastDate.getTime()));
        return str.toString();
    }
}

Related

  1. getNDayAfterCurrentDate(String dateStr, String dateFormat, int n)
  2. getOtherDayLastUpdateTimeFormat()
  3. getPaxBirthday()
  4. getPriorDay(int offset, String pattern)
  5. getRunningTime(Date date, SimpleDateFormat sday, String line)
  6. getSignContinusDay(Date lastSignTime)
  7. getSpcilNumDayArray(Date startDate, int num)
  8. getSpecifiedDayAfter(String specifiedDay)
  9. getSpecifiedDayAfter(String specifiedDay, int afterDay)