com.pmease.quickbuild.util
Class TimeUtils
java.lang.Object
com.pmease.quickbuild.util.TimeUtils
public class TimeUtils
- extends java.lang.Object
Method Summary |
static long |
ago(long duration)
|
static long |
ago(long now,
long duration)
|
static long |
closestTime(long approxTime,
long interval)
Given the approximate time associated with a data point and the interval
at which that data point is being collected, compute the exact data point
to which the data point corresponds. |
static long |
minus(long now,
long duration)
|
static long |
now()
|
static long |
nowUnixTime()
|
static long |
plus(long now,
long duration)
|
static long |
roundDownTime(long approxTime,
long interval)
Given the approximate time associated with a data point and the interval
at which that data point is being collected, compute the exact data point
to which the data point corresponds. |
static long |
toUnixTime(long millisSinceEpoch)
|
static java.util.Date |
unixTimeToDate(long epoch)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SECOND
public static final long SECOND
- See Also:
- Constant Field Values
MINUTE
public static final long MINUTE
- See Also:
- Constant Field Values
FIVE_MINUTE
public static final long FIVE_MINUTE
- See Also:
- Constant Field Values
HOUR
public static final long HOUR
- See Also:
- Constant Field Values
DAY
public static final long DAY
- See Also:
- Constant Field Values
SIX_HOUR
public static final long SIX_HOUR
- See Also:
- Constant Field Values
TimeUtils
public TimeUtils()
nowUnixTime
public static long nowUnixTime()
toUnixTime
public static long toUnixTime(long millisSinceEpoch)
unixTimeToDate
public static java.util.Date unixTimeToDate(long epoch)
now
public static long now()
ago
public static long ago(long duration)
ago
public static long ago(long now,
long duration)
plus
public static long plus(long now,
long duration)
minus
public static long minus(long now,
long duration)
roundDownTime
public static long roundDownTime(long approxTime,
long interval)
- Given the approximate time associated with a data point and the interval
at which that data point is being collected, compute the exact data point
to which the data point corresponds.
- Parameters:
approxTime
- the approximate time to which the data point correspondsinterval
- the collection interval
- Returns:
- the time, rounded down to the previous collection interval
closestTime
public static long closestTime(long approxTime,
long interval)
- Given the approximate time associated with a data point and the interval
at which that data point is being collected, compute the exact data point
to which the data point corresponds.
- Parameters:
approxTime
- the approximate time to which the data point correspondsinterval
- the collection interval
- Returns:
- the time, rounded up or down to the closest collection interval
Copyright © 2005-2010 PMEase Inc. All Rights Reserved.