Java Long Number to Date formatDate(long p_millis)

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

Description

Formats an epoch date in a standard way: MM/dd/yyyy

License

Open Source License

Parameter

Parameter Description
p_millis The epoch date/time

Return

The formatted string

Declaration

public static String formatDate(long p_millis) 

Method Source Code

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

import java.text.DateFormat;

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

public class Main {
    /**/*from ww w. jav  a2  s . co m*/
     * Formats an epoch date in a standard way: MM/dd/yyyy
     * @param p_millis The epoch date/time
     * @return The formatted string
     */
    public static String formatDate(long p_millis) {
        Date date = new Date(p_millis);
        DateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
        return formatter.format(date);
    }
}

Related

  1. formatDate(long millis, Locale locale)
  2. formatDate(long millis, String dateFormat)
  3. formatDate(long millisecond, String format)
  4. formatDate(long ms)
  5. formatDate(long ms)
  6. formatDate(long t)
  7. formatDate(long time)
  8. formatDate(long time)
  9. formatDate(long time)