Java Day of Week toStartWeek(Date date)

Here you can find the source of toStartWeek(Date date)

Description

set the date at the first day of the week.o

License

LGPL

Parameter

Parameter Description
date a parameter

Declaration

public static Date toStartWeek(Date date) 

Method Source Code

//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();
    }
}

Related

  1. nextWeek(Date date)
  2. nextWeek(final Date date)
  3. previousWeek(long date)
  4. previousWeek(long date)
  5. startOfWeek(Date date)
  6. toWeekDayUS(Date date, int expect)
  7. truncDateToIsoWeek(Date d)
  8. weekCount(Date start, Date end)
  9. weekDay(final Date date)