|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.erights.e.develop.format.ETimeFormat
Untamed: Just converts back and forth between milliseconds since the epoch (standard binary time representation) and ISO8601/UTC (standard sortable textual respresentation) but enhanced to represent milliseconds.
Field Summary | |
private static java.text.DateFormat |
SortableFormat
|
Constructor Summary | |
ETimeFormat()
Enabled: |
Method Summary | |
static String |
formatTime(long absMillis)
Enabled: Shows absMillis (since epoch) as a sortable absolute date/time string that can be included in a single URI field (no "#"s or "/"s). |
static long |
parseTime(String sortableTime)
Enabled: Given a sortableTime string in the format returned by millisToDate, return the corresponding number of seconds since the epoch. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.text.DateFormat SortableFormat
Constructor Detail |
public ETimeFormat()
Method Detail |
public static String formatTime(long absMillis)
The format must also be independent of Locale, the default current TimeZone, or the current time. In the terminology of ISO601, the actual format is "YYYY-MM-DDThh:mm:ss.sssTZD", where the value of TZD (timezone) is "Z", indicating UTC (Universal Standard Time, which is just another name for GMT).
It would be good if the format returned could also be used
within filenames, but unfortunately this conflicts with the
familiar use of colon (":") to represent clock time, as
mandated by ISO8601. Clients (such as the Trace system) that
need to embed the result in a filename should do a
.replace(':','_'). parseTime(String)
will handle either colons or underbars in its input.
public static long parseTime(String sortableTime) throws java.text.ParseException
java.text.ParseException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |