I have this date and I want to forward it ahead in time, adding a few weeks to it.
This is how I do it
int weeks = 4;
newDate.set(Calendar.HOUR_OF_DAY, hoursAndMinutes.get(Calendar.HOUR_OF_DAY));
newDate.set(Calendar.MINUTE, hoursAndMinutes.get(Calendar.MINUTE));
newDate.set(Calendar.SECOND, 0);
newDate.set(Calendar.MILLISECOND, Utils.returnRandomNumberBetween(1, 999));
dateFormat.format(newDate.getTime());
dateInMiliseconds = newDate.getTimeInMillis() + weeks * 604800000; // 604800000 is a week's worth of miliseconds
Now, instead of moving the date like 4 weeks ahead, it moves it back to the same week day but in May?
EDIT: To the guys that pointed out my question is a possible duplicate - it would have been a possible duplicate if I knew the problem was in casting, which I didnt know.