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.sql.Date;

import java.util.Calendar;

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 Date(theYear, theMonth, theDay)).toString();
    }//from  w ww .  j a  v a2s  . c  o m
}

Related

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