java 日期 运算

  SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
  Date date = df.parse(Console.readString("请输入个给定日期,日期格式:yyyy-MM-dd"));
  int num = Console.readInt("给定的日期");
  System.out.println(df.format(new Date(date.getTime()+num*24*60*60*1000)));
  System.out.println(date.getTime());
原文地址:https://www.cnblogs.com/baoguo/p/1250450.html