public static void setTime ( Calendar cal , Date time ) { if ( time != null ) { Calendar startCalendar = popCalendar ( time ) ; cal . set ( Calendar . HOUR_OF_DAY , startCalendar . get ( Calendar . HOUR_OF_DAY ) ) ; cal . set ( Calendar . MINUTE , startCalendar . get ( Calendar . MINUTE ) ) ; cal . set ( Calendar . SECOND , startCalendar . get ( Calendar . SECOND ) ) ; pushCalendar ( startCalendar ) ; } }
Given a date represented by a Calendar instance set the time component of the date based on the hours and minutes of the time supplied by the Date instance .