How can I add an int (minutes) to LocalDateTime.now()?

user2765654 picture user2765654 · May 21, 2015 · Viewed 31.6k times · Source

I want to modify LocalDateTime.now() by adding a certain amount of minutes to it. How do I do that?

Answer

Raghuveer picture Raghuveer · May 21, 2015

If you are using java 8 then you can still use the same syntax

LocalDateTime fiveMinutesLater = LocalDateTime.now().plusMinutes(5)