Here you can find the source of getPreviuosRoundMonth(Date baseDate)
Description:Get the date after the base date passed in as first parameter and interval is specified by second parameter
Parameter | Description |
---|---|
String | baseDate Str |
public static Date getPreviuosRoundMonth(Date baseDate)
//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; } }