/**
* 上月最后一天
* @throws ParseException
*/
@SuppressWarnings("deprecation")
@Test
public void testGetMonthLastDay() throws ParseException{
Timestamp timestamp=null;
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH, 1);
calendar.add(Calendar.DATE, -1);
calendar.getTimeInMillis();
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.s");
System.out.println( new Timestamp(calendar.getTimeInMillis()));
}
输出数字2016-10-31 15:39:58.188是Timestamp类型 ,sql拼装
最新推荐文章于 2023-10-23 17:41:11 发布