Android Date Get getDateObj()

Here you can find the source of getDateObj()


get Date Obj


Apache License


public static Date getDateObj() 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public class Main {
    public static Date getDateObj(int year, int month, int day) {
        Calendar c = new GregorianCalendar();
        c.set(year, month - 1, day);/*www.  j ava  2  s.  c om*/
        return c.getTime();

    public static Date getDateObj(String argsDate, String split) {
        String[] temp = argsDate.split(split);
        int year = new Integer(temp[0]).intValue();
        int month = new Integer(temp[1]).intValue();
        int day = new Integer(temp[2]).intValue();
        return getDateObj(year, month, day);

    public static Date getDateObj() {
        Calendar c = new GregorianCalendar();
        return c.getTime();


  1. getDaysOfCurMonth(final String time)
  2. getMonth(Date date)
  3. getTomorrowAtEight()
  4. getWeekOfDate(Date dt)
  5. getYear(Date date)
  6. getDate(int year, int month, int date, int hourOfDay, int minute, int second)
  7. getCurrentDateYearMonthDateHourMinuteSecond()
  8. createDate(final int month, final int day, final int year)
  9. getDate(int year, int month)