Java Long Number to Date formatDate(long time)

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

Description

format Date

License

Creative Commons License

Declaration

public static String formatDate(long time) 

Method Source Code


//package com.java2s;
//License from project: Creative Commons License 

import java.text.DateFormat;

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

public class Main {
    private static final DateFormat dateFormat = new SimpleDateFormat("yyyy-MMM-dd_HH-mm-ss-SSS_zzz",
            Locale.ENGLISH);// ww w .  java  2 s.c  o  m

    public static String formatDate(Date date) {
        return getDateFormat().format(date);
    }

    public static String formatDate(long time) {
        return formatDate(new Date(time));
    }

    public static DateFormat getDateFormat() {
        return dateFormat;
    }
}

Related

  1. formatDate(long ms)
  2. formatDate(long p_millis)
  3. formatDate(long t)
  4. formatDate(long time)
  5. formatDate(long time)
  6. formatDate(long time)
  7. formatDate(long time, String format)
  8. formatDate(long time_millis)
  9. formatDate(long timeStamp)