Java Day in Month dayForMonth(String pTime)

Here you can find the source of dayForMonth(String pTime)

Description

day For Month

License

Open Source License

Declaration

public static int dayForMonth(String pTime) throws Exception 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class Main {
    public static int dayForMonth(String pTime) throws Exception {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        Calendar c = Calendar.getInstance();
        c.setTime(format.parse(pTime));//from  ww  w.  ja v a 2  s.co  m
        int m = c.get(Calendar.DAY_OF_MONTH);
        return m;
    }
}

Related

  1. currentMonthFirstDay()
  2. daysInMonth(int month, boolean isLeapYear)
  3. daysInMonth(int month, int year)
  4. daysInMonth(int year, int month)
  5. daysOfMonth(int year)