I have a LocalDateTime
object myDateTime
that I can see in the debugger that has:
2015-12-12T23:59:59.000
I do: myDateTime.plusSeconds(1)
but the timestamp remains the same.
What am I messing up?
Most types in Joda Time (at least the ones you should use) are immutable. You can't change their value - but you can call methods which return a new value. You're calling the right method in this case, but you need to remember the result, e.g.
myDateTime = myDateTime.plusSeconds(1);
See more on this question at Stackoverflow