Android Date Time Get getDate()

Here you can find the source of getDate()

Description

get Date

Declaration

public static String getDate() 

Method Source Code

//package com.java2s;
import java.util.Calendar;
import java.sql.Date;

public class Main {
    public static String getDate() {
        Calendar c = Calendar.getInstance();
        int theYear = c.get(Calendar.YEAR) - 1900;
        int theMonth = c.get(Calendar.MONTH);
        int theDay = c.get(Calendar.DAY_OF_MONTH);
        //return (new GregorianCalendar(theYear, theMonth, theDay)).toString();
        return (new Date(theYear, theMonth, theDay)).toString();

    }/*  w w  w .j  a v a  2  s .  c o  m*/
}

Related

  1. getDatetime()
  2. isNight()
  3. getDateDifference(Date thenDate)
  4. currentTimeLabel()
  5. currentTimeToString(int format, String delimiter)
  6. getDate()