Java tutorial
//package com.java2s; import android.text.format.Time; public class Main { public static boolean isThisYear(long when) { Time time = new Time(); time.set(when); int thenYear = time.year; // int thenMonth = time.month; int thenMonthDay = time.monthDay; time.set(System.currentTimeMillis()); return (thenYear == time.year) && (thenMonthDay != time.monthDay); } }