|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.rssowl.util.DateParser
public final class DateParser
Utility class providing convenience methods to (XML) parsing mechanisms.
| Field Summary | |
|---|---|
private static java.text.DateFormat |
DATE_FORMAT
Formatter for Date based on OS Locale |
private static java.text.DateFormat |
DATE_LONG_FORMAT
Formatter for Date (long) based on OS Locale |
private static java.text.DateFormat |
DATE_TIME_FORMAT
Formatter for Date and Time based on OS Locale |
private static java.text.DateFormat |
DATE_TIME_LONG_FORMAT
Formatter for Date and Time (long) based on OS Locale |
private static java.text.SimpleDateFormat[] |
dateFormats
An array of common date formats |
| Constructor Summary | |
|---|---|
private |
DateParser()
This utility class constructor is hidden |
| Method Summary | |
|---|---|
static java.lang.String |
dateToFileName(java.lang.String date)
Remove special chars of a date to use it into a filename |
static java.lang.String |
formatDate()
Format the current date to a String using the selected Locale and do not add the time to the String |
static java.lang.String |
formatDate(boolean withTime)
Format the current date to a String using the selected Locale. |
static java.lang.String |
formatDate(java.util.Date date,
boolean withTime)
Format the date to a String using the selected Locale. |
static java.lang.String |
formatDate(java.util.Date date,
boolean longDateFormat,
boolean withTime)
Format the date to a String using the selected Locale. |
static java.lang.String |
formatLongDate(java.util.Date aDate)
Get the localized long date format for the given language. |
static java.util.Date |
getDate(java.lang.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 java.text.DateFormat DATE_FORMAT
private static final java.text.DateFormat DATE_LONG_FORMAT
private static final java.text.DateFormat DATE_TIME_FORMAT
private static final java.text.DateFormat DATE_TIME_LONG_FORMAT
private static java.text.SimpleDateFormat[] dateFormats
| Constructor Detail |
|---|
private DateParser()
| Method Detail |
|---|
public static java.lang.String dateToFileName(java.lang.String date)
date - The date as String
public static java.lang.String formatDate()
public static java.lang.String formatDate(boolean withTime)
withTime - If TRUE set time to date String
public static java.lang.String formatDate(java.util.Date date,
boolean withTime)
date - The date to formatwithTime - If TRUE set time to date String
public static java.lang.String formatDate(java.util.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 java.lang.String formatLongDate(java.util.Date aDate)
aDate - The date to format
public static java.util.Date getDate(java.lang.String strdate)
strdate - Date as String
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||