package com.wx.application.util;

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


public class DateUtils {
	
	public static String fn1(Integer interval, String date) {
		try {
			SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
			Calendar cal = Calendar.getInstance();
			cal.setTime(sf.parse(date));
			cal.add(Calendar.DAY_OF_YEAR, interval);
			return sf.format(cal.getTime());
		} catch (Exception e) {
		}
		return null;
	}
	
	/**
	 * 按秒添加
	 * @param interval
	 * @param date
	 * @return
	 */
	public static Date fn2(Integer interval) {
		Calendar cal = Calendar.getInstance();
		cal.add(Calendar.SECOND, interval);
		return cal.getTime();
	}
}
