Java Long Number to Date formatDate(long date)

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

Description

format Date

License

Apache License

Parameter

Parameter Description
date long: 141536480014L

Declaration

public static String formatDate(long date) 

Method Source Code

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

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    private static final String DEFAULT_DATE_PATTERN = "yyyy-MM-dd";

    public static String formatDate(Date date, String pattern) {
        SimpleDateFormat format = new SimpleDateFormat(pattern);
        return format.format(date);
    }//from w  w  w .j  av  a 2s  .com

    public static String formatDate(Date date) {
        return formatDate(date, DEFAULT_DATE_PATTERN);
    }

    /**
     * @param date long: 141536480014L
     * @return
     */
    public static String formatDate(long date) {
        return formatDate(new Date(date), DEFAULT_DATE_PATTERN);
    }
}

Related

  1. formatDate(long absTime)
  2. formatDate(long d)
  3. formatDate(long d)
  4. formatDate(long date)
  5. formatDate(long date)
  6. formatDate(long date)
  7. formatDate(long date)
  8. formatDate(long date)
  9. formatDate(long date)