Here you can find the source of getDay(String stringDate)
public static String getDay(String stringDate)
//package com.java2s; import java.util.*; public class Main { public static String getDay() { Calendar calendar = Calendar.getInstance(); String d = "0" + calendar.get(Calendar.DATE); d = d.substring(d.length() - 2, d.length()); return d; }/*from w ww.j a v a2 s .c o m*/ public static String getDay(java.sql.Timestamp ts) { String oracleDate = ""; if (ts != null) { oracleDate = ts.toString().substring(0, 10); oracleDate = getDay(oracleDate); } return oracleDate; } public static String getDay(String stringDate) { String day = ""; int checkyear = -1; if (stringDate.trim().equals("")) { return ""; } else { int index = stringDate.indexOf("-"); int lastIndex = stringDate.lastIndexOf("-"); day = stringDate.substring(lastIndex + 1, lastIndex + 3); return day; } } }