Android Date Format getCurrentDate()

Here you can find the source of getCurrentDate()

Description

get Current Date

Declaration

public static String getCurrentDate() 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static String getCurrentDate() {
        return getFormatDateTime(new Date(), "yyyy-MM-dd");
    }//from w  w w.j a  va  2s  .c o  m

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

Related

  1. formatTM(Date d)
  2. fromString(String dateStr)
  3. fromString(String dateStr, String dateFormat)
  4. fromString(String dateStr, String dateFormat, Locale locale)
  5. getBeforeYear()
  6. getCurrentDateString(String dateFormat)
  7. getCurrentDateTime()
  8. getCurrentDay()
  9. getCurrentDayOfWeek()