Android Long to Date Convert generateFileName(long sysTime)

Here you can find the source of generateFileName(long sysTime)

Description

Generate file name from system time in the format "yyyyMMdd-HHmmss-SSS",

License

Apache License

Parameter

Parameter Description
sysTime System time in milliseconds

Declaration

public static String generateFileName(long sysTime) 

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 {
    /**//  w ww .j  a  va2  s .com
     * Generate file name from system time in the format "yyyyMMdd-HHmmss-SSS",
     * @param sysTime System time in milliseconds
     */
    public static String generateFileName(long sysTime) {
        return new SimpleDateFormat("yyyyMMdd-HHmmss-SSS", Locale.US)
                .format(new Date(sysTime));
    }
}

Related

  1. formatDurationShort(Context context, long millis)
  2. formatPublishDaysAgo(long timestamp)
  3. formatTime(final long time)
  4. formatToCountdown(long millis)
  5. fullFromUtc(long milliseconds)
  6. getDateForMillis(final long tick)
  7. getDateLabel(long date)
  8. getDateString(long date, int style, Locale locale)
  9. getDateString(long time)