構文
public String getYear()
戻り値
年を表すストリング。年の値には世紀が含まれます。例えば、1998 や 2004 です。
例
DtpDate toDay = new DtpDate(); DtpDate lastYear= toDay.addYears(-1); System.out.println("Next month is " + lastYear.getDayOfMonth() + "/" + lastYear.getNumericMonth() + "/" + lastYear.getYear() + " " + lastYear.getHours() + ":" + lastYear.getMinutes() + ":" + lastYear.getSeconds());
参照項目