Class DateUtil

java.lang.Object
com.logicaldoc.util.time.DateUtil

public class DateUtil extends Object
Utility methods to handle dates
Since:
8.6.1
Author:
Marco Meschieri - LogicalDOC
  • Method Details

    • format

      public static String format(Date date)
      Formats a date using the ISO format yyyy-MM-dd HH:mm:ss Z
      Parameters:
      date - the date to format
      Returns:
      the formatted date
    • formatWithMillis

      public static String formatWithMillis(Date date)
      Formats a date using the ISO format yyyy-MM-dd HH:mm:ss.SSS Z
      Parameters:
      date - the date to format
      Returns:
      the formatted date
    • parse

      public static Date parse(String formattedDate)
      Formats a date using one of the ISO formats.
      Parameters:
      formattedDate - the string to parse
      Returns:
      the parsed date
    • truncateToDay

      public static Date truncateToDay(Date date)