Class DateBean

java.lang.Object
java.util.Date
com.logicaldoc.core.i18n.DateBean
All Implemented Interfaces:
Serializable, Cloneable, Comparable<Date>

public class DateBean extends Date
This class converts a date into some formats.
Version:
1.1
Author:
Michael Scholz, Sebastian Stein
See Also:
  • Constructor Details

    • DateBean

      public DateBean()
  • Method Details

    • toCompactString

      public static String toCompactString()
      This method returns the current date in the format yyyyMMdd HH:mm:ss.
      Returns:
      current date in format yyyyMMdd HH:mm:ss
    • dateFromCompactString

      public static Date dateFromCompactString(String compactString)
      This method creates the Date object for a compact string in the format yyyyMMdd HH:mm:ss or yyyyHHdd.
      Parameters:
      compactString - compact text representation of the date
      Returns:
      the date
    • toCompactString

      public static String toCompactString(Date date)
      This method formats a a date into format yyyymmdd.
      Parameters:
      date - the date to be converted
      Returns:
      a string containing the converted date
    • toCompactString

      public static String toCompactString(String date, String dateFormat)
      This method formats a string with format dd.mm.yyyy into format yyyymmdd.
      Parameters:
      date - string containing the date to be converted
      dateFormat - format of the date
      Returns:
      a string containing the converted date
    • convertDate

      public static String convertDate(String formatIn, String formatOut, String dateIn)
      Converts a string containing a date between the given formats.
      Parameters:
      formatIn - current format of the string
      formatOut - format the string should be converted to
      dateIn - the string containing a date in the formatIn
      Returns:
      returns the converted string in the formatOut