Class DateTimeHelper
java.lang.Object
org.torproject.metrics.descriptorparser.utils.DateTimeHelper
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final long
static final long
static final long
static final long
static final String
static final String
static final String
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
format
(long millis) static String
static long
Parses the given string usingISO_DATETIME_FORMAT
as format and return the time in milliseconds since the epoch orNO_TIME_AVAILABLE
if the string cannot be parsed.static long
Parses the given string using the given format and return the time in milliseconds since the epoch orNO_TIME_AVAILABLE
if the string cannot be parsed.
-
Field Details
-
NO_TIME_AVAILABLE
public static final long NO_TIME_AVAILABLE- See Also:
-
ONE_SECOND
public static final long ONE_SECOND- See Also:
-
TEN_SECONDS
public static final long TEN_SECONDS- See Also:
-
ONE_MINUTE
public static final long ONE_MINUTE- See Also:
-
FIVE_MINUTES
public static final long FIVE_MINUTES- See Also:
-
FIFTEEN_MINUTES
public static final long FIFTEEN_MINUTES- See Also:
-
FOURTY_FIVE_MINUTES
public static final long FOURTY_FIVE_MINUTES- See Also:
-
ONE_HOUR
public static final long ONE_HOUR- See Also:
-
FOUR_HOURS
public static final long FOUR_HOURS- See Also:
-
SIX_HOURS
public static final long SIX_HOURS- See Also:
-
TWELVE_HOURS
public static final long TWELVE_HOURS- See Also:
-
ONE_DAY
public static final long ONE_DAY- See Also:
-
TWO_DAYS
public static final long TWO_DAYS- See Also:
-
THREE_DAYS
public static final long THREE_DAYS- See Also:
-
ONE_WEEK
public static final long ONE_WEEK- See Also:
-
TEN_DAYS
public static final long TEN_DAYS- See Also:
-
ROUGHLY_ONE_MONTH
public static final long ROUGHLY_ONE_MONTH- See Also:
-
ROUGHLY_THREE_MONTHS
public static final long ROUGHLY_THREE_MONTHS- See Also:
-
ROUGHLY_SIX_MONTHS
public static final long ROUGHLY_SIX_MONTHS- See Also:
-
ROUGHLY_ONE_YEAR
public static final long ROUGHLY_ONE_YEAR- See Also:
-
ROUGHLY_FIVE_YEARS
public static final long ROUGHLY_FIVE_YEARS- See Also:
-
ISO_DATETIME_FORMAT
- See Also:
-
ISO_DATETIME_TAB_FORMAT
- See Also:
-
ISO_YEARMONTH_FORMAT
- See Also:
-
DATEHOUR_NOSPACE_FORMAT
- See Also:
-
-
Method Details
-
format
-
format
-
parse
Parses the given string using the given format and return the time in milliseconds since the epoch orNO_TIME_AVAILABLE
if the string cannot be parsed. -
parse
Parses the given string usingISO_DATETIME_FORMAT
as format and return the time in milliseconds since the epoch orNO_TIME_AVAILABLE
if the string cannot be parsed.
-