下面的代码比我通过的时间少了一天,为什么它少于一天返回“Fri Aug 27 13:00:00 PDT 2010”。日期时间问题,少返回一天
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Locale;
import java.util.TimeZone;
Locale locale = new Locale("en", "US");
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd", locale);
TimeZone timeZone = TimeZone.getTimeZone("Etc/GMT-4");
dateFormat.setTimeZone(timeZone);
System.out.println(dateFormat.parse("2010-08-28"));
http://stackoverflow.com/questions/18122608/simpledateformat-parse-loses-timezone – ray
此线程有同样的问题。 http://stackoverflow.com/questions/17581112/java-simpledateformat-timezone-parsing – edubriguenti