Here you can find the source of formatDate(long timestamp)
public static String formatDate(long timestamp)
//package com.java2s; //License from project: Apache License import java.time.*; import java.time.format.DateTimeFormatter; public class Main { protected static final ZoneId UTC_ZONE = ZoneId.of("UTC"); protected static final DateTimeFormatter DATE_PARSER_FORMATTER = DateTimeFormatter.ofPattern("uuuuMMdd"); public static String formatDate(long timestamp) { return Instant.ofEpochMilli(timestamp).atZone(UTC_ZONE).format(DATE_PARSER_FORMATTER); }/*from w w w .j ava 2s. c o m*/ }