Switch to full style
General Java code examples
Post a reply

get next date by next day

Sun Jun 20, 2010 9:07 am

Following code allow you to get the next or the previous date by a number of days :

Code:


 
public Date seekDateByDay(Date date,int daySeek){
    
Object[] params = { date,daySeek };
 
    if(
date == null){
        return 
null;
    }
    
Calendar seekedDate Calendar.getInstance();
    
seekedDate.setTime(date);        
    
seekedDate.set(Calendar.DAY_OF_MONTHseekedDate.get(Calendar.DAY_OF_MONTH)+daySeek);
 
    return 
seekedDate.getTime();
    
    }
 




Post a reply
  Related Posts  to : get next date by next day
 Want start and end date of a month from current date     -  
 Formatting a Date with date()     -  
 date validation in asp     -  
 Date in Java     -  
 How To Increment Date In JSP?     -  
 String to sql.Date     -  
 Convert String to Date     -  
 date formatting in Java     -  
 Google indexing DATE     -  
 make class of date     -  

Topic Tags

Java Time