Android examples for java.util:Year
Get current year as String
//package com.java2s; import java.util.Calendar; public class Main { /**/*w ww . j ava 2 s .co m*/ * Get current year * @return year in String format */ public static String currentYear() { Calendar cal = Calendar.getInstance(); int year = cal.get(Calendar.YEAR); return String.valueOf(year); } }