@ GwtIncompatible ( "incompatible method" ) private static long getFragment ( final Date date , final int fragment , final TimeUnit unit ) { validateDateNotNull ( date ) ; final Calendar calendar = Calendar . getInstance ( ) ; calendar . setTime ( date ) ; return getFragment ( calendar , fragment , unit ) ; }
Gets a Date fragment for any unit .