Java Year Current getCurrentYearMonthDay()

Here you can find the source of getCurrentYearMonthDay()

Description

get Current Year Month Day

License

Apache License

Declaration

public static int[] getCurrentYearMonthDay() 

Method Source Code

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

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

public class Main {

    public static int[] getCurrentYearMonthDay() {
        return getYearMonthDay(new Date());
    }//from   w  w  w .  j  a  v a2 s  .  c  o m

    public static int[] getYearMonthDay(Date date) {
        Calendar bgnDate = Calendar.getInstance();
        bgnDate.setTime(date);
        return new int[] { bgnDate.get(Calendar.YEAR),
                bgnDate.get(Calendar.MONTH) + 1, bgnDate.get(Calendar.DATE) };
    }
}

Related

  1. getCurrentYear()
  2. getCurrentYear()
  3. getCurrentYear()
  4. getCurrentYearFirst()
  5. getCurrentYearMonth()
  6. getCurrYear()
  7. getCurrYearFirst()
  8. getLastDayOfCurrentYear()
  9. getYear()