With JodaTime , without using the plus or minus functions and using the smallest lines of code, how can I set a new date without changing the time?
My first attempt was to store the "temporary" parts of DateTime in a separate int using getHoursOfDay() and getMinutesOfHour() , etc. - then create a new DateTime with the desired date and set the hours, minutes and seconds back. But this method is pretty awkward, and I was wondering if there was a less complicated method for this - ideally with just one line of code.
For instance:
22/05/2013 13:40:02 β β 30/08/2014 13:40:02
source share