Class UTCDateUtil

java.lang.Object
io.vertigo.core.lang.json.UTCDateUtil

public final class UTCDateUtil extends Object
Utility class for handling UTC date conversions in JSON processing. Supports multiple date formats: - ISO8601 (primary) - RFC 822/1123 - RFC 850/1036 Handles both Date and Instant types with timezone awareness.
  • Method Details

    • formatISO8601

      public static String formatISO8601(Date date)
      Formats date to ISO8601 UTC string. Preserves date truncation information.
      Parameters:
      date - Date to format
      Returns:
      UTC date string in ISO8601 format
    • formatInstantISO8601

      public static String formatInstantISO8601(Instant instant)
      Formats Instant to ISO8601 UTC string.
      Parameters:
      instant - Instant to format
      Returns:
      UTC string in ISO8601 format
    • parse

      public static Date parse(String inputDate)
      Parses UTC date string to Date. Attempts multiple format patterns in order.
      Parameters:
      inputDate - UTC date string
      Returns:
      Parsed Date object
      Throws:
      com.google.gson.JsonParseException - if date format is not supported
    • parseInstant

      public static Instant parseInstant(String inputDate)
      Parses date string to Instant. Attempts multiple format patterns in order.
      Parameters:
      inputDate - Date string to parse
      Returns:
      Parsed Instant object
      Throws:
      com.google.gson.JsonParseException - if date format is not supported