包名:
import java.text.SimpleDateFormat;
方法:
public static String subDate(Date oneTime){
//截取年月日
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String formatDate = sdf.format(oneTime);
String dateTime = formatDate.substring(0,4)+formatDate.substring(5,7)+formatDate.substring(8,10);
return dateTime ;
}