Java Date Previous getPreviuosRoundMonth(Date baseDate)

Here you can find the source of getPreviuosRoundMonth(Date baseDate)

Description

Description:Get the date after the base date passed in as first parameter and interval is specified by second parameter

License

Open Source License

Parameter

Parameter Description
String baseDate Str

Return

Date

Declaration

public static Date getPreviuosRoundMonth(Date baseDate) 

Method Source Code

//package com.java2s;
/*/*w w w  .ja v  a  2s . co  m*/
 * $RCSfile: DatetimeUtil,v $$
 * $Revision: 1.0  $
 * $Date: 2011  $
 *
 * Copyright (C) 2011 GyTech, Inc. All rights reserved.
 *
 * This software is the proprietary information of GyTech, Inc.
 * Use is subject to license terms.
 */

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

public class Main {
    /**
     * <p>Description:Get the date after the base date passed in as first parameter and interval is
     *                         specified by second parameter
     * </p>
     * @param String baseDate Str
     * @return Date 
     */
    public static Date getPreviuosRoundMonth(Date baseDate) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(baseDate);
        calendar.set(Calendar.DATE, 1);
        calendar.set(Calendar.HOUR, 0);
        calendar.set(Calendar.MINUTE, 0);
        Date resultDate = calendar.getTime();

        return resultDate;
    }
}

Related

  1. getPreviousMonday(Date day)
  2. getPreviousMonth(Date time)
  3. getPreviousMonth(long date)
  4. getPreviousMonthFirst(Date appointDate)
  5. getPreviousQuarterStartDate(Date dt)
  6. previousDay(Date date)
  7. previousDay(long date)
  8. previousDay(long date)
  9. previousDayLastHour(final Date pDate)