Java Day of Month getDayOfMonth(Date dt)

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

Description

Get and return the day of month from the given Date dt

License

Open Source License

Parameter

Parameter Description
dt The given Date

Return

day The int value for day of month

Declaration

public static int getDayOfMonth(Date dt) 

Method Source Code

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

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

public class Main {
    /**/*  www .j  a va2s. com*/
     * Get and return the day of month from the given Date dt
     * 
     * @param dt
     *            The given Date
     * 
     * @return day The int value for day of month
     */
    public static int getDayOfMonth(Date dt) {
        Calendar cal = new GregorianCalendar();
        cal.setTime(dt);
        return (cal.get(Calendar.DAY_OF_MONTH));
    }
}

Related

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