java.util.Dateを用いることで、現在の日付を取得できます。
sample.java
import java.util.Date;
class Sample {
public static void main(String args[]) {
Date now = new Date();
System.out.println(now);
//一年後
long timeStamp = now.getTime() + (long)365*24*3600*1000;
Date oneYearLater = new Date(timeStamp);
System.out.println(oneYearLater);
}
}
出力例
$ javac sample.java && java Sample
Mon Aug 12 22:48:48 JST 2013
Tue Aug 12 22:48:48 JST 2014