Java Day getDayOfDate(Date date)

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

Description

get Day Of Date

License

Apache License

Declaration

public static Integer getDayOfDate(Date date) 

Method Source Code


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

import java.text.DateFormat;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static DateFormat yyyyMMddFormat = new SimpleDateFormat("yyyyMMdd");

    public static Integer getDayOfDate(Date date) {
        return Integer.valueOf(yyyyMMddFormat.format(date));
    }//from ww  w .jav  a  2  s. c  om

    public static Integer getDayOfDate(Long date) {
        Date dt = new Date();
        dt.setTime(date);
        return Integer.valueOf(yyyyMMddFormat.format(dt));
    }
}

Related

  1. getDayInWeekForMonthIn2Characters(int year, int month)
  2. getDayName(String dateString)
  3. getDayNameForDate(java.util.Date dt, boolean fullname)
  4. getDayNames(Locale locale)
  5. getDayNumber()
  6. getDayOffset(String date, int offset, String format)
  7. getDayofTheDate(Date d1)
  8. getDAYOFWEEK(String strDate)
  9. getDayRange(String bday, String eday)