|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.stardust.common.DateUtils
public class DateUtils
This utility class provides convenience methods for date / time related conversions and checks.
| Constructor Summary | |
|---|---|
DateUtils()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
formatDate(java.util.Date date)
Returns a String representation for given Date object using date formatter with default style for default locale. |
static java.lang.String |
formatDateTime(java.util.Date date)
Returns a String representation for given Date object. |
static java.lang.String |
formatDurationAsString(double durationInHours)
Returns the given duration in hours as formatted string. Format is: hours:minutes:seconds h Example : 1:05:20 h |
static java.lang.String |
formatTime(java.util.Date date)
Returns a String representation for given Date object using time formatter with default style for default locale. |
static java.text.SimpleDateFormat |
getInteractiveDateFormat()
Factory which creates a SimpleDateFormat instance which can be used to format Dates to strings with pattern "yyyy/MM/dd hh:mm:ss". |
static java.text.SimpleDateFormat |
getNoninteractiveDateFormat()
Factory which creates a SimpleDateFormat instance which can be used to format Dates to strings with pattern "yyyy/MM/dd hh:mm:ss:SSS". |
static long |
getTimestamp(java.util.Date date,
long def)
Returns number of milliseconds since January 1, 1970, 00:00:00 GMT represented by given Date object. |
static boolean |
isValidISODateFormat(java.lang.String date)
Checks if the input date conforms to an ISO date pattern (e.g. |
static boolean |
isValidNonInteractiveFormat(java.lang.String date)
Checks if the input date conforms to the non-interactive date format yyyy/MM/dd hh:mm:ss:SSS. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DateUtils()
| Method Detail |
|---|
public static java.text.SimpleDateFormat getNoninteractiveDateFormat()
SimpleDateFormatpublic static java.text.SimpleDateFormat getInteractiveDateFormat()
SimpleDateFormat
public static long getTimestamp(java.util.Date date,
long def)
date - the Date object.def - the default value used if Date object is null.
Date.getTime()public static java.lang.String formatDateTime(java.util.Date date)
date - the Date object.
DateFormat.getDateInstance(),
DateFormat.getTimeInstance()public static java.lang.String formatDate(java.util.Date date)
date - the Date object.
DateFormat.getDateInstance()public static java.lang.String formatTime(java.util.Date date)
date - the Date object.
DateFormat.getTimeInstance()public static java.lang.String formatDurationAsString(double durationInHours)
durationInHours - the duration in hours.
public static boolean isValidISODateFormat(java.lang.String date)
date - String representation of date.
true if the date conforms to an ISO date pattern,
false if it does not conformpublic static boolean isValidNonInteractiveFormat(java.lang.String date)
date - String representation of date.
true if the date conforms to this pattern,
false if it does not conform
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||