Java Week Day getPreDay()

Here you can find the source of getPreDay()

Description

get Pre Day

License

Open Source License

Declaration

public static String getPreDay() 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * @(#)DateUtil.java Oct 23, 2007//from  www.j av  a 2  s  .c  om
 *
 * Copyright 2007 Neusoft Group Ltd. All rights reserved.
 * Neusoft PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 *******************************************************************************/

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

public class Main {

    public static String getPreDay() {
        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.DAY_OF_WEEK, -1);
        Date preTime = calendar.getTime();
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
        return formatter.format(preTime);
    }
}

Related

  1. getMonday(String date)
  2. getMonday(String date, int weekDay)
  3. getMondayAfter(Date date)
  4. getMondayOfThisWeek()
  5. getNextDayOfweek()
  6. getPreviousDay(long date, int startOfWeek)
  7. getPreviousFriday(String date)
  8. getPreviousMonday(Date date, int days)
  9. getPreviousOrNextDay(String time, int dayNum)