Package com.logicaldoc.core.i18n
Class DateBean
java.lang.Object
java.util.Date
com.logicaldoc.core.i18n.DateBean
- All Implemented Interfaces:
- Serializable,- Cloneable,- Comparable<Date>
This class converts a date into some formats.
- Version:
- 1.1
- Author:
- Michael Scholz, Sebastian Stein
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic StringconvertDate(String formatIn, String formatOut, String dateIn) Converts a string containing a date between the given formats.static DatedateFromCompactString(String compactString) This method creates the Date object for a compact string in the format yyyyMMdd HH:mm:ss or yyyyHHdd.static StringThis method returns the current date in the format yyyyMMdd HH:mm:ss.static StringtoCompactString(String date, String dateFormat) This method formats a string with format dd.mm.yyyy into format yyyymmdd.static StringtoCompactString(Date date) This method formats a a date into format yyyymmdd.Methods inherited from class java.util.Dateafter, before, clone, compareTo, equals, from, getDate, getDay, getHours, getMinutes, getMonth, getSeconds, getTime, getTimezoneOffset, getYear, hashCode, parse, setDate, setHours, setMinutes, setMonth, setSeconds, setTime, setYear, toGMTString, toInstant, toLocaleString, toString, UTC
- 
Constructor Details- 
DateBeanpublic DateBean()
 
- 
- 
Method Details- 
toCompactStringThis method returns the current date in the format yyyyMMdd HH:mm:ss.- Returns:
- current date in format yyyyMMdd HH:mm:ss
 
- 
dateFromCompactStringThis 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
 
- 
toCompactStringThis method formats a a date into format yyyymmdd.- Parameters:
- date- the date to be converted
- Returns:
- a string containing the converted date
 
- 
toCompactStringThis 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
 
- 
convertDateConverts 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
 
 
-