Is this a Java DateFormat bug?
Posted
by anonymous
on Stack Overflow
See other posts from Stack Overflow
or by anonymous
Published on 2010-06-11T20:19:25Z
Indexed on
2010/06/11
20:22 UTC
Read the original article
Hit count: 314
The pattern is "dd-MM-yyyy"
I think the string "01-01-2010mwwwwwwwwwwwwwww" does not satisfy the pattern, but the following code shows the contrary.
Anyone can explain why?
public static void main(String[] args) throws Exception {
SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy");
Date date = df.parse("01-01-2010mwwwwwwwwwwwwwww");
System.out.println(date);
}
Thanks
© Stack Overflow or respective owner