Android Date Format getFormatDate(String format)

Here you can find the source of getFormatDate(String format)

Description

get Format Date

Declaration

public static String getFormatDate(String format) 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static String getFormatDate(Date date) {
        return getFormatDateTime(date, "yyyy-MM-dd");
    }/*from  w  w  w.j  a  va 2s  . com*/

    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. getFormatCurrentTime(String format)
  2. getFormatCurrentTime(String format)
  3. getFormatDate(Date date)
  4. getFormatDate(Date date)
  5. getFormatDate(String format)
  6. getFormatDateAdd(Date date, int amount, String format)
  7. getFormatDateAdd(Date date, int amount, String format)
  8. getFormatDateTime(Date date, String format)
  9. getFormatDateTime(Date date, String format)