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 short 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 short getDayOfMonth(Date date) {
        assertDateParamsRequired(date);/*ww w.  j  av  a2s .com*/

        Calendar c = Calendar.getInstance();
        c.setTime(date);

        return (short) c.get(Calendar.DAY_OF_MONTH);
    }

    private static void assertDateParamsRequired(Date... dates) {
        for (Date date : dates) {
            if (date == null) {
                throw new IllegalArgumentException("The Date type parameters are required.");
            }
        }
    }
}

Related

  1. adjustToDayOfMonth(Date dt, int day)
  2. dayOfMonth(Date date)
  3. dayOfMonthOf(Date date)
  4. getDayofMonth(Date date)
  5. getDayOfMonth(Date date)
  6. getDayOfMonth(Date date)
  7. getDayOfMonth(Date date)
  8. getDayOfMonth(Date dt)