use heuristics to interpret inputs that do not precisely match this object's format.

If you set this to false your code will does what you expect.

So that the code does not need to create a new DateFormat object each time and incur the cost of parsing the date pattern, you might want to consider making that object an instance variable. Then you only incur the cost of parsing the actual date string and not both the pattern and the date string each time the method is called.