Here you can find the source of stringifyDate(long timestamp)
public static String stringifyDate(long timestamp)
//package com.java2s; //License from project: Apache License import java.time.Instant; import java.time.OffsetDateTime; import java.time.ZoneOffset; import java.util.TimeZone; public class Main { public static String stringifyDate(OffsetDateTime date) { date = date.withOffsetSameInstant(ZoneOffset.ofHours(2)); return (date.getDayOfMonth() < 10 ? "0" + date.getDayOfMonth() : date.getDayOfMonth()) + "/" + (date.getMonthValue() < 10 ? "0" + date.getMonthValue() : date.getMonthValue()) + "/" + date.getYear() + " " + (date.getHour() < 10 ? "0" + date.getHour() : date.getHour()) + ":" + (date.getMinute() < 10 ? "0" + date.getMinute() : date.getMinute()); }/*from w ww . j a va 2 s . co m*/ public static String stringifyDate(long timestamp) { return stringifyDate( OffsetDateTime.ofInstant(Instant.ofEpochMilli(timestamp), TimeZone.getTimeZone("GMT").toZoneId())); } }