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

孤者浪人 提交于 2020-03-14 05:43:24

问题


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


回答1:


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

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


来源:https://stackoverflow.com/questions/30374796/how-can-i-add-an-int-minutes-to-localdatetime-now

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!