Java Day dayOfDate(Date s)

Here you can find the source of dayOfDate(Date s)

Description

day Of Date

License

Open Source License

Declaration

static public int dayOfDate(Date s) throws ParseException 

Method Source Code

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

import java.text.ParseException;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    /**/*from w  w  w  . j  a va  2s . c  o  m*/
     * format pattern : yyyy-MM-dd
     */
    public static final SimpleDateFormat FORMAT_YYYY_MM_DD = new SimpleDateFormat("yyyy-MM-dd");

    static public int dayOfDate(Date s) throws ParseException {
        String d = FORMAT_YYYY_MM_DD.format(s);
        return Integer.parseInt(d.substring(8, 10));
    }

    static public String format(Date date, String formatText) throws Exception {
        SimpleDateFormat format = new SimpleDateFormat(formatText);
        return format.format(date);
    }
}

Related

  1. dayFillter(String text, String type)
  2. dayFillter(String text, String type)
  3. dayFilter(Date date)
  4. dayForAMorPM(String date)
  5. dayFormat(Date date)
  6. dayOfWeekAbr(Date date)
  7. daysFrom(Date date, int amount, String format)
  8. daysOfnumbe(Date sDate, int number)
  9. daySub(Date fDate, Date oDate)