Java Date to Year getYearMonthDay(Date date)

Here you can find the source of getYearMonthDay(Date date)

Description

get Year Month Day

License

Apache License

Declaration

public static int[] getYearMonthDay(Date date) 

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[] getYearMonthDay(Date date) {
        Calendar bgnDate = Calendar.getInstance();
        bgnDate.setTime(date);/*from w  ww . ja  va2  s  .c om*/
        return new int[] { bgnDate.get(Calendar.YEAR),
                bgnDate.get(Calendar.MONTH) + 1, bgnDate.get(Calendar.DATE) };
    }
}

Related

  1. getYearBegin(final Date date)
  2. getYearBetweenTwoDate(Date fdate, Date tdate)
  3. getYearFromDate(Date date)
  4. getYearFromDate(Date date)
  5. getYearMonth(Date date)
  6. getYearMonthDay(Date date)
  7. getYearMonthInt(Date date)
  8. getYearMonthOfLastMon(Date date)
  9. getYearNumber(Date date)