Java Week Day getFriday(Date date)

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

Description

get Friday

License

Apache License

Declaration

public static String getFriday(Date date) 

Method Source Code

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

import java.text.SimpleDateFormat;
import java.util.Calendar;

import java.util.Date;

public class Main {

    public static String getFriday(Date date) {
        Calendar c = Calendar.getInstance();
        c.setTime(date);/*w  ww .  j  ava2s.  c  om*/
        c.set(Calendar.DAY_OF_WEEK, Calendar.FRIDAY);
        return new SimpleDateFormat("yyyy-MM-dd").format(c.getTime());
    }
}

Related

  1. getFirstDayOfWeek(final Date date)
  2. getFirstDayOfWeek(String format)
  3. getFirstDayOfWeek(String str, int week)
  4. getFirstDayOfWeek(String week)
  5. getFirstDayOfWeek(String week)
  6. getLastDayOfCurrWeek()
  7. getLastDayOfWeek(int year, int month)
  8. getLastSundayBeforeThisWeek()
  9. getLastWeekday()