public interface DateParser extends DateBasic
Date 对象
Thanks to Apache Commons Lang 3.5| Modifier and Type | Method and Description |
|---|---|
Date |
parse(String source)
将日期字符串解析并转换为
Date 对象
等价于 DateFormat.parse(String) |
Date |
parse(String source,
ParsePosition pos)
将日期字符串解析并转换为
Date 对象
等价于 DateFormat.parse(String, ParsePosition) |
boolean |
parse(String source,
ParsePosition pos,
Calendar calendar)
根据给定格式转换日期字符串
Updates the Calendar with parsed fields.
|
Object |
parseObject(String source)
将日期字符串解析并转换为
Date 对象 |
Object |
parseObject(String source,
ParsePosition pos)
根据
ParsePosition 给定将日期字符串解析并转换为 Date 对象 |
getLocale, getPattern, getTimeZoneDate parse(String source) throws ParseException
Date 对象
等价于 DateFormat.parse(String)source - 日期字符串DateParseException - 转换异常,被转换的字符串格式错误Date parse(String source, ParsePosition pos)
Date 对象
等价于 DateFormat.parse(String, ParsePosition)source - 日期字符串pos - ParsePositionDateboolean parse(String source, ParsePosition pos, Calendar calendar)
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.Object parseObject(String source) throws ParseException
Date 对象source - A String whose beginning should be parsed.ParseException - if the beginning of the specified string cannot be parsed.Format.parseObject(String)Object parseObject(String source, ParsePosition pos)
ParsePosition 给定将日期字符串解析并转换为 Date 对象source - A String whose beginning should be parsed.pos - the parse positionDateFormat.parseObject(String, ParsePosition)Copyright © 2019. All rights reserved.