Java tutorial
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { private static Locale locale = Locale.KOREA; public static boolean equalsYear(Date a, Date b) { SimpleDateFormat yearFormat = new SimpleDateFormat("yyyy", locale); return yearFormat.format(a).equals(yearFormat.format(b)); } }