Java SQL Date Create getDay(Date date)

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

Description

get Day

License

Apache License

Declaration

public static Integer getDay(Date date) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.sql.Date;

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

public class Main {
    public static Integer getDay(Date date) {
        return initCalendar(date).get(Calendar.DAY_OF_MONTH);
    }/* w  w  w . j av a2  s .  c o  m*/

    private static Calendar initCalendar(Date date) {
        Calendar calendar = new GregorianCalendar();
        calendar.setTime(date);
        return calendar;
    }
}

Related

  1. getDateFormat()
  2. getDateFormat(java.util.Date date)
  3. getDateString(String date)
  4. getDateString(String pattern)
  5. getDateString2()
  6. getDay(final java.sql.Date date)
  7. getDay(String stringDate)
  8. getDayByMonthSeed(Date date, int monthSeed)
  9. getDayByWeekString(Date date, String weekString)