Android Gregorian Date Create dateInts2String(int year, int month, int day)

Here you can find the source of dateInts2String(int year, int month, int day)

Description

date Ints String

Declaration

public static String dateInts2String(int year, int month, int day) 

Method Source Code

//package com.java2s;
import java.text.SimpleDateFormat;
import java.util.GregorianCalendar;

public class Main {
    public static String dateInts2String(int year, int month, int day) {
        try {/*from w ww  .  j av a2  s  . c o m*/
            GregorianCalendar dateGC = new GregorianCalendar(year, month,
                    day);
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
            String date = sdf.format(dateGC.getTime());
            return date;
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
}

Related

  1. isGregorianDate(int year, int month, double day)
  2. isValid(int year, int month, int day)
  3. getDateObj(int year, int month, int day)
  4. getCalendar()