Android examples for java.util:Year
Get the year from a calendar to a string.
//package com.java2s; import java.util.Calendar; import java.util.GregorianCalendar; public class Main { /**/*from w ww. j a v a2 s .co m*/ * Get the year from a calendar to a string. * @param calendar The Calendar to convert. * @return The formatted year. */ public static String convertToYearString(GregorianCalendar calendar) { return Integer.toString(calendar.get(Calendar.YEAR)); } }