Java tutorial
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.GregorianCalendar; import java.util.Locale; public class Main { private static SimpleDateFormat dfYear = new SimpleDateFormat("yyyy", Locale.ITALIAN); public static String getYear(GregorianCalendar cal) { return dfYear.format(cal.getTime()); } }