Java Week End getFirstDayOfWeek(Date date)

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

Description

get First Day Of Week

License

Open Source License

Declaration

@SuppressWarnings("deprecation")
public static Date getFirstDayOfWeek(Date date) 

Method Source Code

//package com.java2s;

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public class Main {

    @SuppressWarnings("deprecation")
    public static Date getFirstDayOfWeek(Date date) {
        Calendar c = new GregorianCalendar();
        c.setFirstDayOfWeek(Calendar.MONDAY);
        c.setTime(date);//  ww  w  .  jav  a 2  s.com
        c.set(Calendar.DAY_OF_WEEK, c.getFirstDayOfWeek()); // Monday
        return c.getTime();
    }
}

Related

  1. getFirstDayOfWeek(Date date)
  2. getFirstDayOfWeek(Date date)
  3. getFirstDayOfWeek(Date date)
  4. getFirstDayOfWeekFromMonday(Date now)