Java Day of getTheDayBefore(Date date)

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

Description

get The Day Before

License

Open Source License

Declaration

public static Date getTheDayBefore(Date date) 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;
import java.util.*;

public class Main {
    private final static SimpleDateFormat sdfTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    public static Date getTheDayBefore(Date date) {
        return new Date(date.getTime() - (long) 24 * (long) 60 * 60 * 1000);
    }//from ww w .j  a va2 s . c  o  m

    public static String getTime() {
        return sdfTime.format(new Date());
    }
}

Related

  1. getStartDate(int days, String strEndDate)
  2. getStartDateByDays(Date endDate, int days)
  3. getStringAfterNDay(String str, int n)
  4. getStringDay(Calendar cal)
  5. getTargetDay(String day, int beforeOrAfterDays)
  6. getThursday(String date)
  7. getTimeOfDaySeconds()
  8. getTimestamp(String format, Integer daysInFuture)
  9. getTwoDay(String sj1, String sj2)