Java Day getDay(SimpleDateFormat df, String dateStr)

Here you can find the source of getDay(SimpleDateFormat df, String dateStr)

Description

get Day

License

Open Source License

Declaration

public static int getDay(SimpleDateFormat df, String dateStr) 

Method Source Code


//package com.java2s;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class Main {

    public static int getDay(SimpleDateFormat df, String dateStr) {
        Calendar c = Calendar.getInstance();
        try {//  w  ww  .j  av a2s.  co  m
            c.setTime(df.parse(dateStr));
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return c.get(Calendar.DATE);
    }

    public static Date parse(SimpleDateFormat df, String date) {
        try {
            return df.parse(date);
        } catch (ParseException e) {
            return null;
        }
    }
}

Related

  1. getDay(Date date)
  2. getDay(Date date)
  3. getDay(Date date)
  4. getDay(Date date, HashMap date2day)
  5. getDay(java.util.Date date)
  6. getDay(String aDate)
  7. GetDay(String agmipDate)
  8. getDAY(String strDate)
  9. getDay(String string)