Java Code Examples for org.joda.time.format.DateTimeFormatter#parseLocalTime()

The following examples show how to use org.joda.time.format.DateTimeFormatter#parseLocalTime() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JodaLocalTimeCodec.java    From actframework with Apache License 2.0 5 votes vote down vote up
@Override
protected LocalTime parse(DateTimeFormatter formatter, String value) {
    if (formatter == super.formatter) {
        // in the default case we might want to patch the value
        String amended = (isIso && !value.endsWith("Z")) ? value + "Z" : value;
        return formatter.parseLocalTime(amended);
    }
    return formatter.parseLocalTime(value);
}
 
Example 2
Source File: LocalTime.java    From astor with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Parses a {@code LocalTime} from the specified string using a formatter.
 * 
 * @param str  the string to parse, not null
 * @param formatter  the formatter to use, not null
 * @since 2.0
 */
public static LocalTime parse(String str, DateTimeFormatter formatter) {
    return formatter.parseLocalTime(str);
}
 
Example 3
Source File: LocalTime.java    From astor with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Parses a {@code LocalTime} from the specified string using a formatter.
 * 
 * @param str  the string to parse, not null
 * @param formatter  the formatter to use, not null
 * @since 2.0
 */
public static LocalTime parse(String str, DateTimeFormatter formatter) {
    return formatter.parseLocalTime(str);
}