|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arunta.base.util.DateTimeFormatter
public class DateTimeFormatter
A collection of date and time utilities.
Constructor Summary | |
---|---|
DateTimeFormatter()
|
Method Summary | |
---|---|
static java.util.Date |
getDate(java.lang.String date)
Converst a string in the yyyy.MM.dd format to a date object. |
static java.util.Date |
getDate(java.lang.String date,
java.lang.String time)
Combines string in the yyyy.MM.dd and HH:mm:ss format and converts teh combination to a date object. |
static java.lang.String |
getFormattedDate(java.util.Date date,
boolean useGMT)
Formats the date part only. |
static java.lang.String |
getFormattedDateTime(java.util.Date date,
boolean useGMT)
Formats the date and time parts. |
static java.lang.String |
getFormattedTime(java.util.Date date,
boolean useGMT)
Formats the time part only. |
static java.lang.String |
getPrintableDate(java.lang.String date)
Converts a date in the yyyy.MM.dd format to a format suitable to display. |
static java.text.DateFormat |
getPrintableDateFormat()
|
static java.lang.String |
getPrintableDateTime(java.util.Date date)
Converts the date to a format suitable to display. |
static java.util.Date |
parseDateTime(java.lang.String dateTime)
Converst a string in the yyyy.MM.dd HH:mm:ss format to a date object. |
static void |
setPrintableDateFormat(java.text.DateFormat dateFormat)
Sets the date and time formater which should be used to format date and time in order to display it. |
static void |
timeZoneChanged()
Reinitialises various date and time formaters with the new time zone. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DateTimeFormatter()
Method Detail |
---|
public static void timeZoneChanged()
public static java.text.DateFormat getPrintableDateFormat()
public static void setPrintableDateFormat(java.text.DateFormat dateFormat)
dateFormat
- An instance of a date and time formater.public static java.lang.String getPrintableDate(java.lang.String date)
date
- The date to format.
public static java.lang.String getPrintableDateTime(java.util.Date date)
date
- The date to format.
public static java.lang.String getFormattedDate(java.util.Date date, boolean useGMT)
date
- The date to format.useGMT
- Set this flag to true
to use the GMT formater.
false
. Otherwise, string in the yyy-MM-dd format.public static java.lang.String getFormattedTime(java.util.Date date, boolean useGMT)
date
- The date to format.useGMT
- Set this flag to true
to use the GMT formater.
public static java.lang.String getFormattedDateTime(java.util.Date date, boolean useGMT)
date
- The date to format.useGMT
- Set this flag to true
to use the GMT formater.
false
. Otherwise, string in the yyy-MM-dd HH:mm:ss
format.public static java.util.Date getDate(java.lang.String date)
date
- A string in the yyyy.MM.dd format.
null
if the date can not be extracetd
from the string.public static java.util.Date getDate(java.lang.String date, java.lang.String time)
date
- A string in the yyyy.MM.dd format.time
- A string in the HH:mm:ss format.
null
if the date can not be extracetd
from the string.public static java.util.Date parseDateTime(java.lang.String dateTime)
dateTime
- A string in the yyyy.MM.dd HH:mm:ss format.
null
if the date can not be extracetd
from the string.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |