Here you can find the source of getMondayOfThisWeek()
public static String getMondayOfThisWeek()
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { /**/* www. ja v a2s . com*/ * @Title: getMondayOfThisWeek * @Description: TODO * @author alterhu2020@gmail.com * @param @return * @return String return type * @throws */ public static String getMondayOfThisWeek() { Calendar c = Calendar.getInstance(); int day_of_week = c.get(Calendar.DAY_OF_WEEK) - 1; if (day_of_week == 0) day_of_week = 7; c.add(Calendar.DATE, -day_of_week + 1); return new SimpleDateFormat("yyyy-MM-dd").format(c.getTime()); } }