Java 使用OpenWeatherMapAPI的日期和时间

Java 使用OpenWeatherMapAPI的日期和时间,java,android,Java,Android,电话:1427700245 我如何将此日期格式更改为2017年3月17日13:40 它向我展示了1969年1月25日01:52:28的精度问题。明确定义日期值为long。 那就行了 试试这个 SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yyyy'T'HH:mm"): String dateString = sdf.format(weatherResponse.getDt()*1000): date.setText(dateString)

电话:1427700245 我如何将此日期格式更改为2017年3月17日13:40


它向我展示了1969年1月25日01:52:28的精度问题。明确定义日期值为long。 那就行了

试试这个

SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yyyy'T'HH:mm"):
String dateString = sdf.format(weatherResponse.getDt()*1000):
date.setText(dateString):
SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yyyy'T'HH:mm"):
String dateString = sdf.format(weatherResponse.getDt()*1000):
date.setText(dateString):