Java tutorial
//package com.java2s; import java.util.Calendar; public class Main { public static int getDayNum(int index) { java.util.Calendar calendar = new java.util.GregorianCalendar(); calendar.add(Calendar.DATE, index);// int dWeek = calendar.get(Calendar.DAY_OF_WEEK); int realDay = (dWeek - 1) == 0 ? 7 : (dWeek - 1); return realDay; } }