题目:
注意Java中日期的运用
代码
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class 十一届纪念日 {
public static void main(String[] args) throws ParseException{
SimpleDateFormat s=new SimpleDateFormat("yyyy-MM-dd");
Date date1=s.parse("1921-7-23");
Date date2=s.parse("2020-7-1");
int a=(int)((date2.getTime()-date1.getTime())/(1000*60));
System.out.println(a);
}
}