Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { public static String getThisYearBirthDateString(final Date birthday) { Date now = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy", Locale.getDefault()); String y = sdf.format(now); sdf = new SimpleDateFormat("M-d", Locale.getDefault()); String md = sdf.format(birthday); String ymd = y + "-" + md; return ymd; } }