Java Long Number to Time longToTimedDate(long time)

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

Description

Convent a long value into a date containing a time-stamp

License

Open Source License

Parameter

Parameter Description
time the long value you wish to convent

Return

the time-stamped date in string form

Declaration

public static String longToTimedDate(long time) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.text.SimpleDateFormat;

public class Main {
    private static final String DATE_FORMAT_NOW = "yyyy-MM-dd HH:mm:ss";

    /**//  w  w  w  .ja  v  a2 s  .  com
     * Convent a long value into a date containing a time-stamp
     * 
     * @param time
     *            the long value you wish to convent
     * @return the time-stamped date in string form
     */
    public static String longToTimedDate(long time) {
        SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
        return sdf.format(Long.valueOf(time));
    }
}

Related

  1. getTimeText(Long oldTime)
  2. getUploadPath(String fileName, long time)
  3. logDuration(Logger logger, Level level, long startTime, String message)
  4. long2Str(long time)
  5. longToPgnDate(long time)
  6. prettyDate(long time)
  7. printDuration(String message, long startTime)
  8. printExecutionTime(long startTime, long endTime, String className, String methodName)
  9. str2Long(String time)