Here you can find the source of getWeekBeginDay(String date)
public static String getWeekBeginDay(String date) throws ParseException
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static String getWeekBeginDay(String date) throws ParseException { Calendar cal = Calendar.getInstance(); SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); cal.setTime(df.parse(date));/*w w w . j a v a 2 s. c om*/ cal.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY); return df.format(cal.getTime()); } }