Android Long to Date Convert getReadableTimeStamp(long timeStamp)

Here you can find the source of getReadableTimeStamp(long timeStamp)

Description

Generate file name from system time in the format "yyyy-MM-dd HH:mm:ss:SSS",

License

Apache License

Parameter

Parameter Description
timeStamp System time in milliseconds

Declaration

public static String getReadableTimeStamp(long timeStamp) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

public class Main {
    /**//from w w w  . j  a  v a2 s. c o m
     * Generate file name from system time in the format "yyyy-MM-dd HH:mm:ss:SSS",
     * @param timeStamp System time in milliseconds
     */
    public static String getReadableTimeStamp(long timeStamp) {
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS", Locale.US)
                .format(new Date(timeStamp));
    }
}

Related

  1. getMinutesSinceStartOfDay(long milliseconds)
  2. getMonth(long dateTimeMillis)
  3. getNameForDcim(long time)
  4. getNameForFile(long time)
  5. getNumberOfDaysPassed(long date1, long date2)
  6. getReadableTimeUsage(long timeUsageMs)
  7. getRelativeDateLabel(long time)
  8. getRelativeTimeFromMilliSeconds(long dateInMillis)
  9. getShortDateString(long date, Locale locale)