Getting yesterday - The method getDate() from the type Date is deprecated

后端 未结 5 641
面向向阳花
面向向阳花 2020-12-20 15:56

I try to get the date of yesterday. So I write the next function:

public  String getYestrday() {
    DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-d         


        
5条回答
  •  臣服心动
    2020-12-20 16:53

    Following works for me

    int date = Calendar.getInstance().get(Calendar.DAY_OF_MONTH);
    

提交回复
热议问题