Here you can find the source of getFormattedTimestamp(@Nonnull Date date)
@Nonnull public static String getFormattedTimestamp(@Nonnull Date date)
//package com.java2s; /**// w w w . j av a 2s . c o m * Created by Adam Kobus on 24.05.2016. * Copyright (c) 2016 inFullMobile * License: MIT, file: /LICENSE */ import javax.annotation.Nonnull; import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static final SimpleDateFormat FORMAT_TIMESTAMP = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss"); @Nonnull public static String getFormattedTimestamp(@Nonnull Date date) { synchronized (FORMAT_TIMESTAMP) { return FORMAT_TIMESTAMP.format(date); } } }