package com.anxin.ssk.cache;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.apache.commons.lang.time.DateUtils;
/**
* @author: (le.qiao)
* @e-mail: qiaolevip@gmail.com
* @myblog: <a href="http://qiaolevip.iteye.com">http://qiaolevip.iteye.com</a>
* @date: 2014-1-17
*
*/
public class C {
public static void main(String[] args) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date today = new Date();
System.out.println(sdf.format(today));
Date anotherDate = DateUtils.addDays(today, 21);
System.out.println(sdf.format(anotherDate));
System.out.println((int) ((anotherDate.getTime() - today.getTime()) / (1000 * 60 * 60 * 24)));
}
}
// 2014-01-17
// 2014-02-07
// 21