我得到的当前日期如下:
public void getCurrentDate(View view) {
Calendar calendar = Calendar.getInstance();
SimpleDateFormat mdformat = new SimpleDateFormat("yyyy / MM / dd ");
String strDate = "Current Date : " + mdformat.format(calendar.getTime());
display(strDate);
}
private void display(String num) {
TextView textView = (TextView) findViewById(R.id.current_date_view);
textView.setText(num);
}
Run Code Online (Sandbox Code Playgroud)
但我想检查该日期是否是今天的日期。但我不知道如何检查。