Java Week Day getPreWeekLastDay()

Here you can find the source of getPreWeekLastDay()

Description

get Pre Week Last Day

License

Apache License

Declaration

public static Date getPreWeekLastDay() 

Method Source Code

//package com.java2s;
//License from project: Apache License 

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

public class Main {

    public static Date getPreWeekLastDay() {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(new Date());

        calendar.setFirstDayOfWeek(1);//from  w  w w .ja  v  a 2s . c o m
        int week = calendar.get(Calendar.DAY_OF_WEEK);
        int day = calendar.get(Calendar.DAY_OF_MONTH);

        calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), day + 1 - week);
        return calendar.getTime();
    }
}

Related

  1. getPreDay()
  2. getPreviousDay(long date, int startOfWeek)
  3. getPreviousFriday(String date)
  4. getPreviousMonday(Date date, int days)
  5. getPreviousOrNextDay(String time, int dayNum)
  6. getShortWeekday(int dayOfWeek)
  7. getShortWeekday(String day)
  8. getSQLForWeekSunday(String weekString)
  9. getSundayOfWeek()