java 字符串与时间

private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS Z");

private SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String date = "2015-12-7T16:00:00.000Z"; 
date = date.replace("Z", " UTC");//注意是空格+UTC
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS Z");//注意格式化的表达式
Date d = format.parse(date );
原文地址:https://www.cnblogs.com/zhxdxf/p/8259557.html