This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Building Blockchain Apps and have Michael Yuan on-line!
See this thread for details.
Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!
    Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
  • Tim Holloway
  • Piet Souris
  • Frits Walraven


Ranch Hand
Posts: 91
  • 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);
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);

When I do this i get an error on i as incompatible datatypes.
which datatype does add(Calendar.DATE) return?
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
  • Report post to moderator
try read the API
Posts: 18671
  • 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.
Of course, I found a very beautiful couch. Definitely. And this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!