杜十娘怒沉百宝箱 感受:在java中怎么样取前一天的日期.然后怎样做为mysql中的where判断条件?
来源:百度文库 编辑:高考问答 时间:2024/05/04 15:08:59
java.util.Calendar ca = java.util.Calendar.getInstance();
ca.add(Calendar.DAY_OF_MONTH, -1);
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd");
String result = sdf.format(ca.getTime());
result就是你要的mysql的数据格式,where可以用类似字符串的等于、大于或者小于来判断