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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
convertDate
(String formatIn, String formatOut, String dateIn) Converts a string containing a date between the given formats.static Date
dateFromCompactString
(String compactString) This method creates the Date object for a compact string in the format yyyyMMdd HH:mm:ss or yyyyHHdd.static String
This method returns the current date in the format yyyyMMdd HH:mm:ss.static String
toCompactString
(String date, String dateFormat) This method formats a string with format dd.mm.yyyy into format yyyymmdd.static String
toCompactString
(Date date) This method formats a a date into format yyyymmdd.Methods inherited from class java.util.Date
after, 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
-
DateBean
public DateBean()
-
-
Method Details
-
toCompactString
This method returns the current date in the format yyyyMMdd HH:mm:ss.- Returns:
- current date in format yyyyMMdd HH:mm:ss
-
dateFromCompactString
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
This method formats a a date into format yyyymmdd.- Parameters:
date
- the date to be converted- Returns:
- a string containing the converted date
-
toCompactString
This method formats a string with format dd.mm.yyyy into format yyyymmdd.- Parameters:
date
- string containing the date to be converteddateFormat
- format of the date- Returns:
- a string containing the converted date
-
convertDate
Converts a string containing a date between the given formats.- Parameters:
formatIn
- current format of the stringformatOut
- format the string should be converted todateIn
- the string containing a date in the formatIn- Returns:
- returns the converted string in the formatOut
-