Here you can find the source of getYear()
public static String getYear() throws ParseException
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { public static String getYear() throws ParseException { Date date = new Date(); SimpleDateFormat formatter; String pattern = "yyyy"; formatter = new SimpleDateFormat(pattern, new Locale("ko", "KOREA")); return formatter.format(date); }/*from w ww . j av a 2s .c om*/ }