org.jppf.utils
Class DateTimeUtils

java.lang.Object
  extended by org.jppf.utils.DateTimeUtils

public final class DateTimeUtils
extends Object

Utility methods for date and time manipulation and conversion.

Author:
Laurent Cohen

Constructor Summary
DateTimeUtils()
           
 
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
 

Constructor Detail

DateTimeUtils

public DateTimeUtils()
Method Detail

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.