Class DateTimeUtil

java.lang.Object
io.apicurio.registry.client.common.util.DateTimeUtil

public class DateTimeUtil extends Object
Utility class for parsing date-time values from Kiota ParseNode with support for legacy date formats. This utility provides backward compatibility with Apicurio Registry servers that use non-ISO-8601 compliant date formats (e.g., "2025-10-29T21:54:37+0000" instead of "2025-10-29T21:54:37+00:00"). The legacy format was used in versions prior to 3.0 when the apicurio.apis.date-format configuration property was set to yyyy-MM-dd'T'HH:mm:ssZ. The legacy date format can be configured via:
  • System property: -Dapicurio.apis.date-format=yyyy-MM-dd'T'HH:mm:ssZ
  • Environment variable: APICURIO_APIS_DATE_FORMAT=yyyy-MM-dd'T'HH:mm:ssZ
See Also:
  • Constructor Details

    • DateTimeUtil

      public DateTimeUtil()
  • Method Details

    • getOffsetDateTimeValue

      public static OffsetDateTime getOffsetDateTimeValue(com.microsoft.kiota.serialization.ParseNode parseNode)
      Attempts to parse an OffsetDateTime value from a ParseNode with fallback support for legacy formats. This method first attempts to use the standard Kiota ParseNode.getOffsetDateTimeValue() method, which expects ISO-8601 compliant date-time strings. If that fails with a DateTimeParseException, it attempts to parse using a legacy format that was used in older versions of Apicurio Registry.
      Parameters:
      parseNode - the ParseNode containing the date-time value to parse
      Returns:
      the parsed OffsetDateTime, or null if the parseNode is null or contains a null value
      Throws:
      DateTimeParseException - if the value cannot be parsed using either the standard or legacy format