Here you can find the source of formatDateTime(long milis)
public static String formatDateTime(long milis)
//package com.java2s; //License from project: Open Source License import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; import java.time.format.DateTimeFormatter; public class Main { private static final DateTimeFormatter DTF = DateTimeFormatter.ofPattern("dd.MM.yyyy HH:mm:ss"); public static String formatDateTime(long milis) { LocalDateTime dateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(milis), ZoneId.systemDefault()); return DTF.format(dateTime); }/*from www .ja v a2 s. co m*/ }