Class DateTime

java.lang.Object
org.basex.util.DateTime

public final class DateTime extends Object
This class contains static, thread-safe methods for parsing and formatting dates and times.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Field Details

  • Method Details

    • parse

      public static Date parse(String date)
      Parses a string and produces a date object. Returns the standard base time if it cannot be converted.
      Parameters:
      date - string representing a date
      Returns:
      parsed date
    • format

      public static String format(Date date)
      Creates a full string representation for the specified date.
      Parameters:
      date - date
      Returns:
      string with the formatted date
    • format

      public static String format(Date date, DateFormat format)
      Creates a string representation for a date in the specified format.
      Parameters:
      format - date format
      date - date
      Returns:
      string with the formatted date