Package org.axonframework.common
Class DateTimeUtils
java.lang.Object
org.axonframework.common.DateTimeUtils
Some utility methods regarding Date and Time.
- Since:
- 3.1
- Author:
- Allard Buijze
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringformatInstant(TemporalAccessor instant) Formats the given instant to ISO8601 format including three positions for milliseconds.static InstantparseInstant(CharSequence timestamp) Parse the giventimestampinto anInstant.
-
Method Details
-
parseInstant
Parse the giventimestampinto anInstant. UnlikeInstant.parse(CharSequence), this method accepts ISO8601 timestamps from any offset, not only UTC.- Parameters:
timestamp- an ISO8601 formatted timestamp- Returns:
- the
Instantrepresenting the given timestamp - See Also:
-
formatInstant
Formats the given instant to ISO8601 format including three positions for milliseconds. This is to provide for a String representation of an instant that is sortable by a textual sorting algorithm.- Parameters:
instant- the instant to represent as ISO8601 data- Returns:
- the ISO8601 representation of the instant in the UTC timezone
-