final class FormattedTime
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.time.format.DateTimeFormatter |
DEFAULT_FORMAT |
Modifier | Constructor and Description |
---|---|
private |
FormattedTime() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
format(java.time.Instant date)
Converts a Date into a formatted string.
|
static java.time.Instant |
parse(java.lang.String s)
Parses a formatted time string into an Instant.
|
public static java.lang.String format(java.time.Instant date)
date
- The Instant to convert.public static java.time.Instant parse(java.lang.String s) throws java.time.format.DateTimeParseException
s
- The string, in the form YYYYMMDDHHMMSS or seconds since epoch (1 January 1970 00:00:00
UTC).java.time.format.DateTimeParseException
- The string was invalid.