@InterfaceAudience.Private public class Times extends Object
Constructor and Description |
---|
Times() |
Modifier and Type | Method and Description |
---|---|
static long |
elapsed(long started,
long finished) |
static long |
elapsed(long started,
long finished,
boolean isRunning) |
static String |
format(long ts) |
static String |
formatISO8601(long ts)
Given a time stamp returns ISO-8601 formated string in format
"yyyy-MM-dd'T'HH:mm:ss.SSSZ".
|
static long |
parseISO8601ToLocalTimeInMillis(String isoString)
Given ISO formatted string with format "yyyy-MM-dd'T'HH:mm:ss.SSSZ", return
epoch time for local Time zone.
|
public static long elapsed(long started, long finished)
public static long elapsed(long started, long finished, boolean isRunning)
public static String format(long ts)
public static String formatISO8601(long ts)
ts
- to be formatted in ISO format.public static long parseISO8601ToLocalTimeInMillis(String isoString) throws ParseException
isoString
- in format of "yyyy-MM-dd'T'HH:mm:ss.SSSZ".ParseException
- if given ISO formatted string can not be parsed.Copyright © 2008–2024 Apache Software Foundation. All rights reserved.