Java Long Number to Date formatDate(long millis, Locale locale)

Here you can find the source of formatDate(long millis, Locale locale)

Description

format Date

License

Open Source License

Declaration

public static String formatDate(long millis, Locale locale) 

Method Source Code


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

import java.text.DateFormat;

import java.util.Date;
import java.util.Locale;

public class Main {
    public static String formatDate(long millis, Locale locale) {
        Date d = new Date();
        d.setTime(millis);//from  w  w w . j a  v  a 2s.  c om
        return formatDate(d, locale);
    }

    public synchronized static String formatDate(Date date, Locale locale) {
        if (date == null) {
            return null;
        }
        DateFormat format = DateFormat.getDateInstance(DateFormat.FULL, locale);
        return format.format(date);
    }
}

Related

  1. formatDate(long dateValue)
  2. formatDate(long epochMillis)
  3. formatDate(long millis)
  4. formatDate(long millis)
  5. formatDate(long millis)
  6. formatDate(long millis, String dateFormat)
  7. formatDate(long millisecond, String format)
  8. formatDate(long ms)
  9. formatDate(long ms)