Class DateBean

    • Constructor Detail

      • DateBean

        public DateBean()
    • Method Detail

      • 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,
                                             String lang)
        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
        lang - from which language it should be converted
        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