How can I increment a date by one day in Java?

前端 未结 28 2204

I\'m working with a date in this format: yyyy-mm-dd.

How can I increment this date by one day?

28条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-21 07:23

    In Java 8 simple way to do is:

    Date.from(Instant.now().plusSeconds(SECONDS_PER_DAY))
    

提交回复
热议问题