如果您正确解析JSON,
feedObj.getString("date");保留您的日期。您正在以String形式读取日期。您必须将其转换为long。
public static void main(String[] args) { Calendar cal = Calendar.getInstance(); Long timestamp = Long.parseLong("1418056895"); //Long.parseLong(feedObj.getString("date")); cal.setTimeInMillis(timestamp * 1000L); DateFormat format = new SimpleDateFormat("MM/dd/yyyy"); // what ever format you need. System.out.println(format.format(cal.getTime())); // this will be in MM/dd/yyyy //item.setTimeStamp(format.format(cal.getTime()));}您还可以使用 feedObj.getLong(“ date”) ; 直接获取长格式的Date,但这取决于您使用的JSON库。



