Code example for TimeUnit

Methods: toMinutes

0
            super(locale);
        } 
 
        @Override 
        public boolean canHandle(final Date date, final long delta) {
            long deltaMinutes = TimeUnit.MILLISECONDS.toMinutes(delta);
            return (deltaMinutes < 60) ? true : false;
        } 
 
        @Override 
        public String format(final Date date, final long delta) {
            long minutes = TimeUnit.MILLISECONDS.toMinutes(delta);
            return format("MinutePastPattern" + getPlural(minutes), minutes);
        } 
    } 
 
    public static class Hour extends AbstractDateHandler { 
 
        public Hour(Locale locale) {
            super(locale);
        }