|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ch.elca.el4j.util.codingsupport.JodaTimeUtils
public class JodaTimeUtils
This class is a class providing static mehtods for conversion between JodaTime formats and strings.
Field Summary | |
---|---|
static String |
DEFAULT_DATE_WITH_COLON
dd:MM:YYYY |
static String |
DEFAULT_DATE_WITH_PERIOD
dd.MM.YYYY |
static String |
DEFAULT_DATE_WITH_WHITESPACE
dd MM YYYY |
static String |
DEFAULT_DATETIME
dd.MM.YY HH:mm:ss |
static String |
TIME_WITH_COLON
HH:mm:ss |
static String |
TIME_WITH_PERIOD
HH.mm.ss |
static String |
TIME_WITH_WHITESPACE
HH mm ss |
Constructor Summary | |
---|---|
protected |
JodaTimeUtils()
Hide default constructor. |
Method Summary | |
---|---|
static String |
getDateTimeString(org.joda.time.DateTime date,
String pattern)
Returns a string containing the date and/or time from the DateTime. |
static String |
getLocalDateString(org.joda.time.LocalDate date,
String pattern)
Returns a string containing the date in a LocalDate. |
static String |
getLocalTimeString(org.joda.time.LocalTime time,
String pattern)
Returns a string containing the time in a LocalTime. |
static org.joda.time.DateTime |
mergeLocalDateAndLocalTime(org.joda.time.LocalDate date,
org.joda.time.LocalTime time)
Creates a DateTime out of a LocalDate and a LocalTime. |
static org.joda.time.DateTime |
parseDateTime(String dateTime,
String pattern)
Returns a DateTime containing the date/time in the string. |
static org.joda.time.DateTime |
parseDateTime(String dateTime,
String pattern,
Locale locale)
Returns a localized DateTime containing the time in the string. |
static org.joda.time.LocalDate |
parseLocalDate(String date,
String pattern)
Returns a LocalDate containing the date in the string. |
static org.joda.time.LocalTime |
parseLocalTime(String time,
String pattern)
Returns a LocalTime containing the time in the string. |
static org.joda.time.DateTime |
setDateOfDateTime(org.joda.time.DateTime dateTime,
org.joda.time.LocalDate date)
Sets the Date (but not the time) of a DateTime to the value in date. |
static org.joda.time.DateTime |
setTimeOfDateTime(org.joda.time.DateTime dateTime,
org.joda.time.LocalTime time)
Changes the time (but not the date) of a DateTime to the time in a LocalTime. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_DATE_WITH_PERIOD
public static final String DEFAULT_DATE_WITH_COLON
public static final String DEFAULT_DATE_WITH_WHITESPACE
public static final String TIME_WITH_PERIOD
public static final String TIME_WITH_COLON
public static final String TIME_WITH_WHITESPACE
public static final String DEFAULT_DATETIME
Constructor Detail |
---|
protected JodaTimeUtils()
Method Detail |
---|
public static String getDateTimeString(org.joda.time.DateTime date, String pattern)
date
- is the DateTime to processpattern
- is the pattern to apply
public static String getLocalDateString(org.joda.time.LocalDate date, String pattern)
date
- is the LocalDate to processpattern
- is the pattern to apply
public static String getLocalTimeString(org.joda.time.LocalTime time, String pattern)
time
- is the LocalTime to processpattern
- is the pattern to apply
public static org.joda.time.DateTime parseDateTime(String dateTime, String pattern)
dateTime
- is the string to processpattern
- is the pattern to apply
public static org.joda.time.LocalDate parseLocalDate(String date, String pattern)
date
- is the string to processpattern
- is the pattern to apply
public static org.joda.time.LocalTime parseLocalTime(String time, String pattern)
time
- is the string to processpattern
- is the pattern to apply
public static org.joda.time.DateTime parseDateTime(String dateTime, String pattern, Locale locale)
dateTime
- is the string to processlocale
- is the local which is applied to the returned DateTime objectpattern
- is the pattern to apply
public static org.joda.time.DateTime mergeLocalDateAndLocalTime(org.joda.time.LocalDate date, org.joda.time.LocalTime time)
date
- is the LocalDate containing the desired datetime
- is the LocalTime containing the desired time
public static org.joda.time.DateTime setTimeOfDateTime(org.joda.time.DateTime dateTime, org.joda.time.LocalTime time)
dateTime
- is the DateTime to settime
- is the time time to set to
public static org.joda.time.DateTime setDateOfDateTime(org.joda.time.DateTime dateTime, org.joda.time.LocalDate date)
dateTime
- is the DateTime for which we set the datedate
- is the LocalDate to set the date to
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |