Java Day of Month getDayOfMonth(Date date)

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

Description

Return day of month.

License

Open Source License

Parameter

Parameter Description
date a parameter

Declaration

public static int getDayOfMonth(Date date) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

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

public class Main {
    public static final Locale LOCALE_DEFAULT = Locale.getDefault();

    public static int getDayOfMonth(Date date) {
        return getCalendar(date).get(Calendar.DAY_OF_MONTH);
    }/*from w  w w . j  a va2 s. c  o  m*/

    public static Calendar getCalendar() {
        return Calendar.getInstance();
    }

    public static Calendar getCalendar(Date datetime) {
        return getCalendar(datetime, LOCALE_DEFAULT);
    }

    public static Calendar getCalendar(Date datetime, Locale locale) {
        Calendar cal = Calendar.getInstance(locale);
        cal.setTime(datetime);
        return cal;
    }
}

Related

  1. dayOfMonth(Date date)
  2. dayOfMonthOf(Date date)
  3. getDayofMonth(Date date)
  4. getDayOfMonth(Date date)
  5. getDayOfMonth(Date date)
  6. getDayOfMonth(Date date)
  7. getDayOfMonth(Date dt)
  8. getDayOfMonth(final Date date)
  9. getFirstDayOfMonth(Date date)