Total members 9951 | Gratitudes |It is currently Sat Feb 11, 2012 10:04 am Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 1 post ] 
Author Code Snippet
 Code subject: get next date by next day
PostPosted: Sun Jun 20, 2010 9:07 am 
Offline
Mastermind
User avatar

Joined: Tue Mar 27, 2007 10:55 pm
Posts: 2103
Location: Earth
Has thanked: 39 time
Have thanks: 56 time

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();
    
    }
 

_________________
Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 1 post ] 
Quick reply


  


 Similar topics
 Topic title   Forum   Author   Comments 
 Want start and end date of a month from current date  Java  Anonymous  1
 date validation in asp  ASP/ASP.net examples  msi_333  0
 date formatting in Java  Java examples  msi_333  0
 How To Store Date Dynamically as a field in mysql using JSP  Servlets / JSP  surya  0
 How To Increment Date In JSP?  Servlets / JSP  surya  2

All times are UTC [ DST ]


Users browsing similar codes

Users browsing this forum: No registered users and 2 guests



Jump to:  
Previous Code Snippet | Next Code Snippet 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team