Java How to convert UTC milliseconds into UTC Date
问题 I have an int 1446159600 which is UTC/GMT date Thu, 29 Oct 2015 23:00:00 GMT. I tried to do conversion to the actual UTC date, but couldn't get it to work with Calendar, SimpleDateFormat, and Timezone classes. Can someone help me? 回答1: // print the time in local time zone Date date = new Date(1446159600); System.out.println(date); // print UTC time TimeZone utcTimeZone = TimeZone.getTimeZone("UTC"); Calendar calendar = Calendar.getInstance(utcTimeZone); SimpleDateFormat simpleDateFormat = new