小编Rav*_*mar的帖子

如何检查日期是否是今天

我得到的当前日期如下:

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)

但我想检查该日期是否是今天的日期。但我不知道如何检查。

android date date-comparison

4
推荐指数
1
解决办法
1万
查看次数

标签 统计

android ×1

date ×1

date-comparison ×1