Java TimeUnit Calculate timeDiff(Date date1, Date date2, TimeUnit minutes)

Here you can find the source of timeDiff(Date date1, Date date2, TimeUnit minutes)

Description

time Diff

License

Open Source License

Declaration

static long timeDiff(Date date1, Date date2, TimeUnit minutes) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.Date;
import java.util.concurrent.TimeUnit;

public class Main {
    static long timeDiff(Date date1, Date date2, TimeUnit minutes) {
        return minutes.convert(date1.getTime() - date2.getTime(), TimeUnit.MILLISECONDS);
    }// w  w  w . j a  v  a  2 s  . c o  m
}

Related

  1. sleep(TimeUnit timeUnit, long duration)
  2. sleep(TimeUnit unit, long length)
  3. sleepAndCachedInterruptedException(long sleepFor, TimeUnit unit)
  4. sleepFor(long period, TimeUnit timeUnit)
  5. timeDiff(Calendar end, Calendar begin, TimeUnit timeUnit)
  6. timeSince(final long startNanos, final TimeUnit destUnit)
  7. waitForEnd(Process process, long timeout, TimeUnit unit)