Here you can find the source of timestamp(long time)
@SuppressWarnings("nls") private static String timestamp(long time)
//package com.java2s; /******************************************************************************* * Copyright (c) 2012, 2016 Andrew Gvozdev and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors:// ww w. j a v a 2 s .com * Andrew Gvozdev - initial API and implementation * IBM Corporation *******************************************************************************/ import java.text.SimpleDateFormat; import java.util.Date; public class Main { /** * Supply timestamp to prefix informational messages. */ @SuppressWarnings("nls") private static String timestamp(long time) { return new SimpleDateFormat("HH:mm:ss").format(new Date(time)) + " "; } }