Package ca.phon.session.format
Class DateFormatter
java.lang.Object
ca.phon.session.format.DateFormatter
@FormatterType(java.time.LocalDate.class)
public class DateFormatter
extends Object
implements Formatter<LocalDate>
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic DateTimeFormatter
Create a date formatter forLocalDateTime
objects.static String
dateTimeToString
(LocalDate dateTime) Convertinvalid @link
DateTime
static String
dateTimeToString
(LocalDateTime dateTime) Convertinvalid @link
DateTime
Convert the given object into a formatted String.Parse the given string into a new object instancestatic LocalDate
stringToDateTime
(String text) Convert a string to ainvalid @link
DateTime
-
Field Details
-
DATETIME_FORMAT
- See Also:
-
-
Constructor Details
-
DateFormatter
public DateFormatter()
-
-
Method Details
-
createFormatter
Create a date formatter forLocalDateTime
objects.- Returns:
- formatter
-
dateTimeToString
Convertinvalid @link
DateTime
- Parameters:
dateTime
-- Returns:
- text
-
dateTimeToString
Convertinvalid @link
DateTime
- Parameters:
dateTime
-- Returns:
- text
-
stringToDateTime
Convert a string to ainvalid @link
DateTime
- Parameters:
text
-- Returns:
- dateTime
- Throws:
IllegalArgumentException
-
format
Description copied from interface:Formatter
Convert the given object into a formatted String. -
parse
Description copied from interface:Formatter
Parse the given string into a new object instance- Specified by:
parse
in interfaceFormatter<LocalDate>
- Returns:
- parsed object
- Throws:
ParseException
- if there was a problem parsing the given text
-