|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sibvisions.util.type.DateUtil
public class DateUtil
The DateUtil is a utility class for date conversion and for formatting dates
as string.
| Constructor Summary | |
|---|---|
DateUtil()
Constructs a new instance of DateUtil with default date format. |
|
DateUtil(DateFormat pDateFormat)
Constructs a new instance of DateUtil that supports empty Strings and null values. |
|
DateUtil(String pDatePattern)
Constructs a new instance of DateUtil that supports empty Strings and null values. |
|
| Method Summary | |
|---|---|
static Date |
convert(Date pDate,
String pFromTimeZone,
String pToTimeZone)
Converts a date from one timezone to another timezone. |
static Date |
convert(Date pDate,
TimeZone pFromTimeZone,
TimeZone pToTimeZone)
Converts a date from one timezone to another timezone. |
String |
format(Date pDate)
Formats the date to text. |
static String |
format(Date pDate,
String pFormat)
Formats a Date into a date/time string. |
static String |
format(long pDate,
String pFormat)
Formats a time string. |
static Date |
getDate(int pDay,
int pMonth,
int pYear,
int pHour,
int pMinutes,
int pSeconds)
Creates a new date instance. |
DateFormat |
getDateFormat()
Gets the date format. |
String |
getDatePattern()
Gets the date format pattern. |
Date |
parse(String pText)
Parses the date from text. |
void |
setDateFormat(DateFormat pDateFormat)
Gets the date format. |
void |
setDatePattern(String pDatePattern)
Gets the date format pattern. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DateUtil()
DateUtil with default date format.
public DateUtil(DateFormat pDateFormat)
DateUtil that supports empty Strings and null values.
pDateFormat - the formatter that should support empty Strings and null valuespublic DateUtil(String pDatePattern)
DateUtil that supports empty Strings and null values.
pDatePattern - the pattern that should support empty Strings and null values| Method Detail |
|---|
public Date parse(String pText)
throws ParseException
pText - the text.
ParseException - if there is an error in the conversionpublic String format(Date pDate)
pDate - the date.
public DateFormat getDateFormat()
public void setDateFormat(DateFormat pDateFormat)
pDateFormat - the date format.public String getDatePattern()
public void setDatePattern(String pDatePattern)
pDatePattern - the date format pattern.
public static String format(long pDate,
String pFormat)
pDate - the time (in millis since 01.01.1970 00:00) value to be formatted into a time stringpFormat - the format
SimpleDateFormat
public static String format(Date pDate,
String pFormat)
pDate - the time value to be formatted into a time stringpFormat - the format
SimpleDateFormat
public static Date getDate(int pDay,
int pMonth,
int pYear,
int pHour,
int pMinutes,
int pSeconds)
pDay - the day of monthpMonth - the monthpYear - the yearpHour - the hour of daypMinutes - the minutespSeconds - the seconds
public static Date convert(Date pDate,
String pFromTimeZone,
String pToTimeZone)
pDate - the datepFromTimeZone - the timezone of the datepToTimeZone - the expected timezone
public static Date convert(Date pDate,
TimeZone pFromTimeZone,
TimeZone pToTimeZone)
pDate - the datepFromTimeZone - the timezone of the datepToTimeZone - the expected timezone
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||