org.jppf.utils
Class DateTimeUtils
java.lang.Object
org.jppf.utils.DateTimeUtils
public final class DateTimeUtils
- extends Object
Utility methods for date and time manipulation and conversion.
- Author:
- Laurent Cohen
|
Method Summary |
static long |
toMillis(long time,
TimeUnit unit)
Convert the specified duration expressed in the specfied time unit into milliseconds. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DateTimeUtils
public DateTimeUtils()
toMillis
public static long toMillis(long time,
TimeUnit unit)
- Convert the specified duration expressed in the specfied time unit into milliseconds.
If the unit is smaller than a millisecond (either
TimeUnit.NANOSECONDS or
TimeUnit.MICROSECONDS), the result will be rounded to the closest millisecond.
- Parameters:
time - the duration to convert.unit - the unit in which the duration is expressed.
- Returns:
- the duration converted to milliseconds.
Copyright © 2005-2010 JPPF Team.