java.time
In March 2014, Java 8 introduced the modern, java.time date-time API which supplanted the error-prone legacy java.util date-time API. Any new code should use the java.time API.
On a side note, never specify 'Z' in a date-time parsing/formatting pattern because 'Z' is a character literal while Z is a pattern character specifying time zone offset. To parse a string representing a time zone offset, you must use X (or XX or XXX depending on the requirement).
Solution using modern date-time API
Since your date-time string is in the default format used by Instant#parse, you can parse it to an Instant directly.
Demo:
import java.time.Instant;
public class Main {
public static void main(String[] args) {
Instant instant = Instant.parse("2013-12-26T01:00:56.664Z");
System.out.println(instant);
}
}
Output:
2013-12-26T01:00:56.664Z
Online Demo
Note: For whatever reason, if you need an instance of java.util.Date from this object of Instant, you can do so as follows:
java.util.Date date = Date.from(instant);
Learn more about the modern date-time API from Trail: Date Time.
SimpleDateFormatin its day was a notorious troublemaker of a class, so since it has been outdated for 10 years, you should never use it any more.Tcorrectly by enclosing it in single quotes, as a literal; but you must never do that withZ.Zis a UTC offset (of zero) and must be parsed as an offset, or you get an incorrect result. It’s all correctly explained in the answer by Arvind Kumar Avinash.