I had code that parses date as follows:
String ALT_DATE_TIME_FORMAT = \"yyyy-MM-dd\'T\'HH:mm:ss.SSSZ\";
SimpleDateFormat sdf = new SimpleDateFormat(
As a more concrete example to @Pangea's suggestion to use JodaTime, this is what you could use:
String timestamp = "2012-09-17T04:11:46Z";
DateTime date = ISODateTimeFormat.dateTimeParser().parseDateTime(timestamp);
This correctly recognizes the UTC timezone. I haven't tried it with milliseconds in the string timestamp, but I'm confident it'll work just as well.
Hope that helps others.
JP