如何向 LocalDateTime.now() 添加一个整数(分钟)?
How can I add an int (minutes) to LocalDateTime.now()?
我想修改 LocalDateTime.now()
,增加一定的分钟数。我该怎么做?
如果您使用的是 java 8,那么您仍然可以使用相同的语法
LocalDateTime fiveMinutesLater = LocalDateTime.now().plusMinutes(5)
我想修改 LocalDateTime.now()
,增加一定的分钟数。我该怎么做?
如果您使用的是 java 8,那么您仍然可以使用相同的语法
LocalDateTime fiveMinutesLater = LocalDateTime.now().plusMinutes(5)