TimeUnit toMinutes() method in Java with Examples
The toMinutes() method of TimeUnit Class is used to get the time represented by the TimeUnit object, as the number of Minutes, since midnight UTC on the 1st January 1970.
public long toMinutes(long duration)
Parameters: This method accepts a mandatory parameter duration which is the duration in milliSeconds.
Return Value: This method returns the converted duration as Minutes.
Below program illustrate the implementation of TimeUnit toMinutes() method:
Time 1539585683206 milliSeconds in Minutes = 25659761
Time 1539585685664 milliSeconds in Minutes = 25659761