JS:
var date = new Date();
date.setMonth(date.getMonth()-3);
alert(date.format(‘dd/MM/yyyy hh:mm:ss‘));
JAVA:
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.MONTH, -3);//得到前3个月
Date formNow3Month = calendar.getTime();
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
sdf.format(formNow3Month)
原文:http://blog.csdn.net/rnzuozuo/article/details/19335721