我不知道如何找到我想要的一周中的某一天?
例如 :
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
String s="2019-10-07";
try {
calendar.setTime(simpleDateFormat.parse(s));
if(Calendar.DAY_OF_WEEK == 2){
Toast.makeText(this, "Mo", Toast.LENGTH_SHORT).show();
}
} catch (ParseException e) {
e.printStackTrace();
}
但它不能正确工作!日历的当前日期只是考虑的,不是我指定的日期。
qq_花开花谢_0
相关分类