public static java . util . Date toDate ( int month , int day , int year , int hour , int minute , int second ) { Calendar calendar = Calendar . getInstance ( ) ; try { calendar . set ( year , month - 1 , day , hour , minute , second ) ; } catch ( Exception e ) { return null ; } return new java . util . Date ( calendar . getTime ( ) . getTime ( ) ) ; }
Makes a Date from separate ints for month day year hour minute and second .