java - Add one day into Joda-Time DateTime -


i have date wed may 08 00:00:00 gmt+06:30 2013. add 1 day using joda-time datetime this.

datetime datetime = new datetime(date); datetime.plusdays(1); 

when print datetime, got date 2013-05-08t00:00:00.000+06:30. joda date time didn't add 1 day. haven't found error.

thanks

the plusdays method not mutator. returns copy of given datetime object change made rather changing given object.

if want change variable datetime value, you'll need:

datetime datetime = new datetime(date); datetime = datetime.plusdays(1); 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -