Java Day of Month getDayOfMonth(Date date)

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

Description

get Day Of Month

License

Apache License

Declaration

public static int getDayOfMonth(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 FIRST_DAY_OF_WEEK = Calendar.MONDAY;

    public static int getDayOfMonth(Date date) {
        Calendar c = getCalendar();
        c.setTime(date);/* ww  w . java  2s  . c o m*/
        return c.getActualMaximum(Calendar.DAY_OF_MONTH);
    }

    private static Calendar getCalendar() {
        Calendar c = Calendar.getInstance();
        c.setFirstDayOfWeek(FIRST_DAY_OF_WEEK);
        return c;
    }
}

Related

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