On 8/20/07, Brian O'Neill <[EMAIL PROTECTED]> wrote:
> To be strict, you need to use the builder and call appendDecimal. It gives
> control over the min and max number of digits that can be parsed.
Thanks for your reply. But this is still parsing (throwing no
exception) when it should not:
public static final DateTimeFormatter formatWithoutMillis =
new DateTimeFormatterBuilder()
.appendDecimal(DateTimeFieldType.year(), 4, 4)
.appendLiteral('-')
.appendDecimal(DateTimeFieldType.monthOfYear(), 2, 2)
.appendLiteral('-')
.appendDecimal(DateTimeFieldType.dayOfMonth(), 2, 2)
.appendLiteral('T')
.appendDecimal(DateTimeFieldType.hourOfDay(), 2, 2)
.appendLiteral(':')
.appendDecimal(DateTimeFieldType.minuteOfHour(), 2, 2)
.appendLiteral(':')
.appendDecimal(DateTimeFieldType.secondOfMinute(), 2, 2)
.appendLiteral('Z')
.toFormatter();
formatWithoutMillis.parseDateTime("2000-10-1T1:32:32Z");
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Joda-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/joda-interest