|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.rssowl.util.DateParser
Utility class providing convenience methods to (XML) parsing mechanisms.
Field Summary | |
private static DateFormat |
DATE_FORMAT
Formatter for Date based on OS Locale |
private static DateFormat |
DATE_LONG_FORMAT
Formatter for Date (long) based on OS Locale |
private static DateFormat |
DATE_TIME_FORMAT
Formatter for Date and Time based on OS Locale |
private static DateFormat |
DATE_TIME_LONG_FORMAT
Formatter for Date and Time (long) based on OS Locale |
private static SimpleDateFormat[] |
dateFormats
An array of common date formats |
Constructor Summary | |
private |
DateParser()
This utility class constructor is hidden |
Method Summary | |
static String |
dateToFileName(String date)
Remove special chars of a date to use it into a filename |
static String |
formatDate()
Format the current date to a String using the selected Locale and do not add the time to the String |
static String |
formatDate(boolean withTime)
Format the current date to a String using the selected Locale. |
static String |
formatDate(Date date,
boolean withTime)
Format the date to a String using the selected Locale. |
static String |
formatDate(Date date,
boolean longDateFormat,
boolean withTime)
Format the date to a String using the selected Locale. |
static String |
formatLongDate(Date aDate)
Get the localized long date format for the given language. |
static Date |
getDate(String strdate)
Tries different date formats to parse against the given string representation to retrieve a valid Date object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final DateFormat DATE_FORMAT
private static final DateFormat DATE_LONG_FORMAT
private static final DateFormat DATE_TIME_FORMAT
private static final DateFormat DATE_TIME_LONG_FORMAT
private static SimpleDateFormat[] dateFormats
Constructor Detail |
private DateParser()
Method Detail |
public static String dateToFileName(String date)
date
- The date as String
public static String formatDate()
public static String formatDate(boolean withTime)
withTime
- If TRUE set time to date String
public static String formatDate(Date date, boolean withTime)
date
- The date to formatwithTime
- If TRUE set time to date String
public static String formatDate(Date date, boolean longDateFormat, boolean withTime)
date
- The date to formatlongDateFormat
- If TRUE use the Long Date FormatwithTime
- If TRUE set time to date String
public static String formatLongDate(Date aDate)
aDate
- The date to format
public static Date getDate(String strdate)
strdate
- Date as String
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |