将yyyy-MM-dd hh:mm:ss转化为yyyy-MM-dd

 Date currentTime = new Date();
		   SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
		   Date strtodate;
		   String datas = "";
		try {
			strtodate = formatter.parse(data);
			datas =  formatter.format(strtodate);
		} catch (ParseException e) {
			e.printStackTrace();
		} 

你可能感兴趣的:(java分享,mm)