Java Long Number to Date formatDate(long d)

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

Description

Convert date to String like "yyyy-MM-dd".

License

Apache License

Declaration

public static String formatDate(long d) 

Method Source Code


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

import java.text.SimpleDateFormat;

public class Main {
    public static String DATE_FORMAT = "yyyy-MM-dd";

    /**/* w  ww. j  a  v  a2 s .c  om*/
     * Convert date to String like "yyyy-MM-dd".
     */
    public static String formatDate(long d) {
        return new SimpleDateFormat(DATE_FORMAT).format(d);
    }
}

Related

  1. formatDate(final long ticks, final SimpleDateFormat format)
  2. formatDate(final long time)
  3. formatDate(final long timestamp)
  4. formatDate(long absTime)
  5. formatDate(long d)
  6. formatDate(long date)
  7. formatDate(Long date)
  8. formatDate(long date)
  9. formatDate(long date)