public static TimeUnit toTimeUnit ( final ChronoUnit tu ) { if ( tu == null ) { return null ; } switch ( tu ) { case DAYS : return TimeUnit . DAYS ; case HOURS : return TimeUnit . HOURS ; case MINUTES : return TimeUnit . MINUTES ; case SECONDS : return TimeUnit . SECONDS ; case MICROS : return TimeUnit . MICROSECONDS ; case MILLIS : return TimeUnit . MILLISECONDS ; case NANOS : return TimeUnit . NANOSECONDS ; default : throw new UnsupportedOperationException ( "Temporal unit is not supported" ) ; } }
To time unit time unit .