I have three variables where I need the current year, one year ago from the present time, and two years ago from the present time, using Java. Would something like this work?:
String DNRCurrentYear = new SimpleDateFormat("yyyy").format(new Date());
Or do I need to make the year an int
in order to subtract one, then two years from?
How would I get the current year minus one, and current year minus two?