Java tutorial
import java.text.DateFormat; import java.text.FieldPosition; import java.util.Date; public class Main { public static void main(String[] argv) throws Exception { DateFormat dateFormat = DateFormat.getDateInstance(); StringBuffer sb = new StringBuffer(); sb = dateFormat.format(new Date(), sb, new FieldPosition(DateFormat.DAY_OF_WEEK_IN_MONTH_FIELD)); System.out.println(sb); } }