Here you can find the source of getDay(String date)
public static int getDay(String date)
//package com.java2s; import java.util.*; public class Main { public static int getDay(String date) { date = deleteSlash(date);// www .j av a 2 s. c o m date = deleteDash(date); return Integer.parseInt(date.substring(6, 8)); } public static String deleteSlash(String value) { return deleteChar(value, "/"); } public static String deleteDash(String value) { return deleteChar(value, "-"); } public static String deleteChar(String source, String deleteStr) { if (source == null || "".equals(source.trim())) { return ""; } StringBuffer temp = new StringBuffer(""); StringTokenizer st = new StringTokenizer(source, deleteStr); while (st.hasMoreTokens()) { temp.append(st.nextToken()); } return temp.toString(); } }