Skip to content Skip to sidebar Skip to footer

Java System.currenttimemillis() In Human Readable Format Utc

Similar question might be asked many times but I couldn't find question which ask for Human Readable Format in UTC time. I want to convert currentTimeMillis() to Human Readable For

Solution 1:

It may help you. If not get back with problem.

long currentTimeMillis = System.currentTimeMillis();
DateFormat dateFormat = new SimpleDateFormat("yy/MM/dd HH:mm");
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
Date date = new Date(currentTimeMillis);
String currentTime = dateFormat.format(date);

Post a Comment for "Java System.currenttimemillis() In Human Readable Format Utc"