How to change only month, year and date in Calendar object without changing the hours, mins and seconds?
I want to set
to have the current time fields (hours, minutes and seconds) but I want to set the year to 1970 January 1st. The code below doesnt do that using the set(int year, int month, int date)
command. The Year, Month and date remains on the current (i.e. today's) date.
Calendar now = Calendar.getInstance();
now.set(1970, Calendar.JANUARY, 01);
How to change the year, month and date field only?