Bookmark Topic Watch Topic
  • New Topic

add(Calendar.DATE)

 
vidhya subramaniam
Ranch Hand
Posts: 91
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
import java.util.Calendar;
import java.util.Properties;
public class datecalc {
public static void main(String args[]){
Calendar rightNow = Calendar.getInstance();
int julianDay = rightNow.get(Calendar.DAY_OF_YEAR);
System.out.println(julianDay);
int day = rightNow.get(Calendar.DATE);

// Create a copy of the rightNow Calendar object
Calendar baseCal = (Calendar)rightNow.clone();
// Subtract 5 days from the date
int i =rightNow.add(Calendar.DATE, -5);
System.out.println(i);

When I do this i get an error on i as incompatible datatypes.
which datatype does add(Calendar.DATE) return?
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
try read the API
Rene
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please follow up your discussion in the original thread rather than starting a new thread for each related question. Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
    Bookmark Topic Watch Topic
  • New Topic