Java tutorial
import java.text.DateFormat; import java.text.FieldPosition; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static void main(String[] argv) throws Exception { SimpleDateFormat formatter = new SimpleDateFormat("yy"); formatter.set2DigitYearStart(new Date()); System.out.println(formatter.format(new Date())); } }