public static java . util . Date toJavaUtilDate ( Date date ) { Calendar cal = Calendar . getInstance ( ) ; cal . set ( Calendar . HOUR_OF_DAY , 0 ) ; cal . set ( Calendar . MINUTE , 0 ) ; cal . set ( Calendar . SECOND , 0 ) ; cal . set ( Calendar . MILLISECOND , 0 ) ; // Calender.MONTH starts from 0 while G C date starts from 1 cal . set ( date . year , date . month - 1 , date . dayOfMonth ) ; return cal . getTime ( ) ; }
Convert a Google Date to a Java Util Date .