Here you can find the source of toStartWeek(Date date)
Parameter | Description |
---|---|
date | a parameter |
public static Date toStartWeek(Date date)
//package com.java2s; //License from project: LGPL import java.util.Calendar; import java.util.Date; public class Main { /**/* w ww .j a v a 2 s. c om*/ * set the date at the first day of the week.o * * @param date * @return */ public static Date toStartWeek(Date date) { Calendar cal = Calendar.getInstance(); cal.setTime(date); cal.set(Calendar.DAY_OF_WEEK, 3); return cal.getTime(); } }