Class DateFormatter
java.lang.Object
ca.phon.session.format.DateFormatter
@FormatterType(LocalDate.class)
public class DateFormatter
extends Object
implements Formatter<LocalDate>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DateTimeFormatterCreate a date formatter forLocalDateTimeobjects.static StringdateTimeToString(LocalDate dateTime) Convertobjects to stringinvalid reference
DateTimestatic StringdateTimeToString(LocalDateTime dateTime) Convertobjects to stringinvalid reference
DateTimeConvert the given object into a formatted String.Parse the given string into a new object instancestatic LocalDatestringToDateTime(String text) Convert a string to aobjectinvalid reference
DateTime
-
Field Details
-
DATETIME_FORMAT
- See Also:
-
-
Constructor Details
-
DateFormatter
public DateFormatter()
-
-
Method Details
-
createFormatter
Create a date formatter forLocalDateTimeobjects.- Returns:
- formatter
-
dateTimeToString
-
dateTimeToString
Convertobjects to stringinvalid reference
DateTime- Parameters:
dateTime-- Returns:
- text
-
stringToDateTime
Convert a string to aobjectinvalid reference
DateTime- Parameters:
text-- Returns:
- dateTime
- Throws:
IllegalArgumentException
-
format
-
parse
Description copied from interface:FormatterParse the given string into a new object instance- Specified by:
parsein interfaceFormatter<LocalDate>- Parameters:
text-- Returns:
- parsed object
- Throws:
ParseException- if there was a problem parsing the given text
-