@InterfaceAudience.Private @InterfaceStability.Evolving public class TimestampRoundDownUtil extends Object
Constructor and Description |
---|
TimestampRoundDownUtil() |
Modifier and Type | Method and Description |
---|---|
static long |
roundDownTimeStampHours(long timestamp,
int roundDownHours) |
static long |
roundDownTimeStampHours(long timestamp,
int roundDownHours,
TimeZone timeZone) |
static long |
roundDownTimeStampMinutes(long timestamp,
int roundDownMins) |
static long |
roundDownTimeStampMinutes(long timestamp,
int roundDownMins,
TimeZone timeZone) |
static long |
roundDownTimeStampSeconds(long timestamp,
int roundDownSec) |
static long |
roundDownTimeStampSeconds(long timestamp,
int roundDownSec,
TimeZone timeZone) |
public static long roundDownTimeStampSeconds(long timestamp, int roundDownSec) throws IllegalStateException
timestamp
- - The time stamp to be rounded down.
For parsing the timestamp the system default timezone will be used.roundDownSec
- - The timestamp is rounded down to the largest
multiple of roundDownSec seconds
less than or equal to timestamp. Should be between 0 and 60.IllegalStateException
roundDownTimeStampSeconds(long, int, TimeZone)
public static long roundDownTimeStampSeconds(long timestamp, int roundDownSec, TimeZone timeZone) throws IllegalStateException
timestamp
- - The time stamp to be rounded down.roundDownSec
- - The timestamp is rounded down to the largest
multiple of roundDownSec seconds
less than or equal to timestamp. Should be between 0 and 60.timeZone
- - The timezone to use for parsing the timestamp.IllegalStateException
public static long roundDownTimeStampMinutes(long timestamp, int roundDownMins) throws IllegalStateException
timestamp
- - The time stamp to be rounded down.
For parsing the timestamp the system default timezone will be used.roundDownMins
- - The timestamp is rounded down to the
largest multiple of roundDownMins minutes less than
or equal to timestamp. Should be between 0 and 60.IllegalStateException
roundDownTimeStampMinutes(long, int, TimeZone)
public static long roundDownTimeStampMinutes(long timestamp, int roundDownMins, TimeZone timeZone) throws IllegalStateException
timestamp
- - The time stamp to be rounded down.roundDownMins
- - The timestamp is rounded down to the
largest multiple of roundDownMins minutes less than
or equal to timestamp. Should be between 0 and 60.timeZone
- - The timezone to use for parsing the timestamp.
If null the system default will be used.IllegalStateException
public static long roundDownTimeStampHours(long timestamp, int roundDownHours) throws IllegalStateException
timestamp
- - The time stamp to be rounded down.
For parsing the timestamp the system default timezone will be used.roundDownHours
- - The timestamp is rounded down to the
largest multiple of roundDownHours hours less than
or equal to timestamp. Should be between 0 and 24.IllegalStateException
roundDownTimeStampHours(long, int, TimeZone)
public static long roundDownTimeStampHours(long timestamp, int roundDownHours, TimeZone timeZone) throws IllegalStateException
timestamp
- - The time stamp to be rounded down.roundDownHours
- - The timestamp is rounded down to the
largest multiple of roundDownHours hours less than
or equal to timestamp. Should be between 0 and 24.timeZone
- - The timezone to use for parsing the timestamp.
If null the system default will be used.IllegalStateException
Copyright © 2009-2016 Apache Software Foundation. All Rights Reserved.