Java Long Number to Timestamp timestamp(long time)

Here you can find the source of timestamp(long time)

Description

Supply timestamp to prefix informational messages.

License

Open Source License

Declaration

@SuppressWarnings("nls")
private static String timestamp(long time) 

Method Source Code

//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))
                + " ";
    }
}

Related

  1. longToDateTime(long timestamp)
  2. longToDateTime(long timestamp)
  3. prettyPrintDate(long timestamp)
  4. printTimestamp(Long c)
  5. reverseTimestampToNormalTime(long timestamp)
  6. timestamp2DataTime(long timestamp)
  7. timestamp2Date(long timestamp, String timezone)
  8. timestamp2DateTime(long t)
  9. timestampToHumanDateAndTime(long timestamp)