有时想修改localDateTime的时间,但是calendar只能修改date的信息,需要把date转换成localDateTime或者把localDateTime修改为date。
//date->localDateTime
Instant.ofEpochMilli(date.getTime()).atZone(ZoneId.systemDefault()).toLocalDateTime
有时想修改localDateTime的时间,但是calendar只能修改date的信息,需要把date转换成localDateTime或者把localDateTime修改为date。
//date->localDateTime
Instant.ofEpochMilli(date.getTime()).atZone(ZoneId.systemDefault()).toLocalDateTime