因此,我现在尝试了几个小时来将时间戳转换为本地日期(CEST)。将UTC时间戳转换为本地日期
Date date = new Date(stamp*1000);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("CEST"));
String myDate = simpleDateFormat.format(date);
它不工作无论我尝试在网上查找我总是回来UTC时间......
为了更好的理解:邮票是long类型,我会一个变量时间戳从服务接收
这应该有所帮助:http://stackoverflow.com/questions/7670355/convert-date-time-for-given-timezone -java – Jens
我尝试了11个upvotes的建议,因为您可能已经看到,它不工作 – Nali
尝试[this](http://stackoverflow.com/questions/19431234/converting-between-java-time-localdatetime-and-java -util-date) –