Class DateTimeUtils

java.lang.Object
org.axonframework.common.DateTimeUtils

public final class DateTimeUtils extends Object
Some utility methods regarding Date and Time.
Since:
3.1
Author:
Allard Buijze
  • Method Details

    • parseInstant

      public static Instant parseInstant(CharSequence timestamp)
      Parse the given timestamp into an Instant. Unlike Instant.parse(CharSequence), this method accepts ISO8601 timestamps from any offset, not only UTC.
      Parameters:
      timestamp - an ISO8601 formatted timestamp
      Returns:
      the Instant representing the given timestamp
      See Also:
    • formatInstant

      public static String formatInstant(TemporalAccessor instant)
      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