Android Calendar Get getDate()

Here you can find the source of getDate()

Description

get Date in format "yyyy-MM-dd HH:mm:ss"

Declaration

public static final String getDate() 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class Main {
    public static final String getDate() {
        Calendar cal = Calendar.getInstance();
        java.text.SimpleDateFormat sdf = new SimpleDateFormat(
                "yyyy-MM-dd HH:mm:ss");
        String cdate = sdf.format(cal.getTime());
        return cdate;
    }/* w  w w  . j  av a2 s  .  c  o  m*/
}

Related

  1. getCurrentTimeStr()
  2. getCurrentWeek()
  3. getCurrentWeek()
  4. getCurrentWeek(Calendar cal)
  5. getDate()
  6. getDate(Calendar c)
  7. getDateAsDirName()
  8. getDateAsF()
  9. getDateAss()