您可以根据需要使用
SimpleDateFormat来格式化日期。
DateFormat df = new SimpleDateFormat("yy"); // Just the year, with 2 digitsString formattedDate = df.format(Calendar.getInstance().getTime());System.out.println(formattedDate);编辑: 根据需要/要求,可以使用我建议的方法或 Robin
建议的方法。理想情况下,当使用Date处理大量操作时,最好使用一种
DateFormat方法。



