[英]How to get calendar from date
I have some date and I want to get last x day before this date so this is my code: 我有一些日期,我想在这个日期之前过去x天,所以这是我的代码:
Calendar today = Calendar.getInstance();
today.add(Calendar.DATE, -x);
date = new Date(today.getTimeInMillis()))
this code works only if some day is actual day. 仅当某天是实际日期时,此代码才有效。 How I can change it.
我该如何更改。 Is there some method to get calendar from date ?
有一些方法可以从日期获取日历吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.