How do I add a scala.concurrent.Duration
to some Java/Scala representation of time to get a time in the future/past?
I really like how scala Duration
adds methods to integers (e.g. 10 seconds
), so I'm trying to do something of the form:
import java.time.LocalDateTime
val futurePoint: LocalDateTime = LocalDateTime.now + (10 Seconds)
I would prefer not use other libraries as suggested in this answer, I'm trying to stick with Java/Scala language libraries.