com.novell.nds.dirxml.driver.xds.util
Class TimeUtil

java.lang.Object
  extended bycom.novell.nds.dirxml.driver.xds.util.TimeUtil

public class TimeUtil
extends Object

A collection of useful time conversion methods.


Field Summary
static long MS_ONE_DAY
          The number of milliseconds in one day.
static long MS_ONE_HALF_HOUR
          The number of milliseconds in one half hour.
static long MS_ONE_HALF_MINUTE
          The number of milliseconds in half a minute.
static long MS_ONE_HOUR
          The number of milliseconds in one hour.
static long MS_ONE_MINUTE
          The number of milliseconds in one minute.
static long MS_ONE_SECOND
          The number of milliseconds in one second.
 
Constructor Summary
TimeUtil()
           
 
Method Summary
static long toDaysFromMillis(long millis, long[] remainder)
          Converts from milliseconds to days.
static long toHoursFromMillis(long millis, long[] remainder)
          Converts from milliseconds to hours.
static long toMillisFromDays(long days)
          Converts from days to milliseconds.
static long toMillisFromHours(long hours)
          Converts from hours to milliseconds.
static long toMillisFromMinutes(long minutes)
          Converts from minutes to milliseconds.
static long toMillisFromSeconds(long seconds)
          Converts from seconds to milliseconds.
static long toMinutesFromMillis(long millis, long[] remainder)
          Converts from milliseconds to minutes.
static long toSecondsFromMillis(long millis, long[] remainder)
          Converts from milliseconds to hours.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MS_ONE_SECOND

public static final long MS_ONE_SECOND
The number of milliseconds in one second.

See Also:
Constant Field Values

MS_ONE_HALF_MINUTE

public static final long MS_ONE_HALF_MINUTE
The number of milliseconds in half a minute.

See Also:
Constant Field Values

MS_ONE_MINUTE

public static final long MS_ONE_MINUTE
The number of milliseconds in one minute.

See Also:
Constant Field Values

MS_ONE_HALF_HOUR

public static final long MS_ONE_HALF_HOUR
The number of milliseconds in one half hour.

See Also:
Constant Field Values

MS_ONE_HOUR

public static final long MS_ONE_HOUR
The number of milliseconds in one hour.

See Also:
Constant Field Values

MS_ONE_DAY

public static final long MS_ONE_DAY
The number of milliseconds in one day.

See Also:
Constant Field Values
Constructor Detail

TimeUtil

public TimeUtil()
Method Detail

toMillisFromSeconds

public static long toMillisFromSeconds(long seconds)
Converts from seconds to milliseconds.

Parameters:
seconds - the number of seconds to convert
Returns:
the number of equivalent milliseconds

toMillisFromMinutes

public static long toMillisFromMinutes(long minutes)
Converts from minutes to milliseconds.

Parameters:
minutes - the number of minutes to convert
Returns:
the number of equivalent milliseconds

toMillisFromHours

public static long toMillisFromHours(long hours)
Converts from hours to milliseconds.

Parameters:
hours - the number of hours to convert
Returns:
the number of equivalent milliseconds

toMillisFromDays

public static long toMillisFromDays(long days)
Converts from days to milliseconds.

Parameters:
days - the number of days to convert
Returns:
the number of equivalent milliseconds

toSecondsFromMillis

public static long toSecondsFromMillis(long millis,
                                       long[] remainder)
Converts from milliseconds to hours.

Parameters:
millis - the number of milliseconds to convert
remainder - the leftover milliseconds
Returns:
the number of equivalent seconds

toMinutesFromMillis

public static long toMinutesFromMillis(long millis,
                                       long[] remainder)
Converts from milliseconds to minutes.

Parameters:
millis - the number of milliseconds to convert
remainder - the leftover milliseconds
Returns:
the number of equivalent minutes

toHoursFromMillis

public static long toHoursFromMillis(long millis,
                                     long[] remainder)
Converts from milliseconds to hours.

Parameters:
millis - the number of milliseconds to convert
remainder - the leftover milliseconds
Returns:
the number of equivalent hours

toDaysFromMillis

public static long toDaysFromMillis(long millis,
                                    long[] remainder)
Converts from milliseconds to days.

Parameters:
millis - the number of milliseconds to convert
remainder - the leftover milliseconds
Returns:
the number of equivalent days