Android Date Format getFormatDate(Date date)

Here you can find the source of getFormatDate(Date date)

Description

get Format Date

License

Apache License

Declaration

public static String getFormatDate(Date date) 

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 getFormatDate(Date date) {
        return getFormatDateTime(date, "yyyy-MM-dd");
    }//w  ww .  java2 s. c  o  m

    public static String getFormatDate(String format) {
        return getFormatDateTime(new Date(), format);
    }

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

Related

  1. getDateEN()
  2. getDefaultFormatter(Date date)
  3. getFormatCurrentAdd(int amount, String format)
  4. getFormatCurrentTime(String format)
  5. getFormatCurrentTime(String format)
  6. getFormatDate(Date date)
  7. getFormatDate(String format)
  8. getFormatDate(String format)
  9. getFormatDateAdd(Date date, int amount, String format)