private static long getDateForHour ( long dt , TimeZone tz , int hour , int dayoffset ) { Calendar c = getCalendar ( tz ) ; c . setTimeInMillis ( dt ) ; int dd = c . get ( Calendar . DAY_OF_MONTH ) ; int mm = c . get ( Calendar . MONTH ) ; int yy = c . get ( Calendar . YEAR ) ; c . set ( yy , mm , dd , hour , 0 , 0 ) ; c . set ( Calendar . MILLISECOND , 0 ) ; if ( dayoffset != 0 ) c . add ( Calendar . DAY_OF_MONTH , dayoffset ) ; return c . getTimeInMillis ( ) ; }
Returns the date for the given hour .