Package org.xbill.DNS

Class FormattedTime

java.lang.Object
org.xbill.DNS.FormattedTime

final class FormattedTime extends Object
Routines for converting time values to and from YYYYMMDDHHMMSS format.
  • Field Details

  • Constructor Details

    • FormattedTime

      private FormattedTime()
  • Method Details

    • format

      public static String format(Instant date)
      Converts a Date into a formatted string.
      Parameters:
      date - The Instant to convert.
      Returns:
      The formatted string.
    • parse

      public static Instant parse(String s) throws DateTimeParseException
      Parses a formatted time string into an Instant.
      Parameters:
      s - The string, in the form YYYYMMDDHHMMSS or seconds since epoch (1 January 1970 00:00:00 UTC).
      Returns:
      The Instant object.
      Throws:
      DateTimeParseException - The string was invalid.