public abstract class DateTimeUtils extends Object
Modifier and Type | Method and Description |
---|---|
static String |
formatInstant(TemporalAccessor instant)
Formats the given instant to ISO8601 format including at least 3 positions for milliseconds.
|
static Instant |
parseInstant(CharSequence timestamp)
Parse the given
timestamp into an Instant . |
public static Instant parseInstant(CharSequence timestamp)
timestamp
into an Instant
. Unlike Instant.parse(CharSequence)
, this
method accepts ISO8601 timestamps from any offset, not only UTC.timestamp
- an ISO8601 formatted timestampInstant
representing the given timestampDateTimeFormatter.ISO_OFFSET_DATE_TIME
public static String formatInstant(TemporalAccessor instant)
instant
- The instant to represent as ISO8601 dataCopyright © 2010–2020. All rights reserved.