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)
如果是SQL server的话
就是dateadd(day,-2,‘2004-10-15’) ;