我有谷歌,但没有找到此代码中的问题。
private Date ConvertToDate(String dateString){
SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm");
Date convertedDate;
try {
convertedDate = dateFormat.parse(dateString);
} catch (ParseException e) {
e.printStackTrace();
return null;
}
return convertedDate;
}
如果GMT为-1,则返回正确的小时,例如小时= 23,但如果GMT + 1,则返回小时= 0,小时= 1。 不明白为什么.....对此有任何帮助? 感谢