Java Long Number to Date convertDate(long timestamp)

Here you can find the source of convertDate(long timestamp)

Description

convert Date

License

Apache License

Declaration

public static String convertDate(long timestamp) 

Method Source Code

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

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static String convertDate(long timestamp) {
        return new SimpleDateFormat("yyyy-MM-dd").format(new Date(timestamp));
    }/*from ww w  . ja  va 2s  .c o  m*/

    public static String format(Date date) {
        return format(date, "yyyy-MM-dd HH:mm:ss");
    }

    public static String format(Date date, String pattern) {
        return new SimpleDateFormat(pattern).format(date);
    }
}

Related

  1. convert(long value, double[] factors, String[] unites)
  2. convert(Long[] targets)
  3. convert2long(String date, String format)
  4. convertDate(long datenum)
  5. convertDate(long millisecs)
  6. convertDate(Long uTime, SimpleDateFormat dateFormat)
  7. convertDateFromLong(Long val)
  8. convertDateFromTimeStamp(long timeStamp, String dateFormat)
  9. convertDateToString(long value)