public interface PositionDateParser extends DateParser
| 限定符和类型 | 方法和说明 |
|---|---|
Date |
parse(String source,
ParsePosition pos)
|
boolean |
parse(String source,
ParsePosition pos,
Calendar calendar)
根据给定格式更新
Calendar
Upon success, the ParsePosition index is updated to indicate how much of the source text was consumed. |
parsegetLocale, getPattern, getTimeZoneDate parse(String source, ParsePosition pos)
source - 日期字符串pos - ParsePositionDateboolean parse(String source, ParsePosition pos, Calendar calendar)
Calendar
Upon success, the ParsePosition index is updated to indicate how much of the source text was consumed.
Not all source text needs to be consumed.
Upon parse failure, ParsePosition error index is updated to the offset of the source text which does not match the supplied format.source - 被转换的日期字符串pos - 定义开始转换的位置,转换结束后更新转换到的位置calendar - The calendar into which to set parsed fields.IllegalArgumentException - when Calendar has been set to be not lenient, and a parsed field is out of range.Copyright © 2024. All rights reserved.