计算商品过期时间. 例如商品的生产日期为 2021-08-09, 60天过期
package com.thc.demo.thread;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
public class TimeTest {
public static void main(String[] args) {
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
String s = "2021-08-09 10:12:05";
LocalDateTime ldt = LocalDateTime.parse(s,df);
LocalDateTime localDateTime = ldt.plusDays(60L);
System.out.println(localDateTime);
}
}



