Java tutorial
//package com.java2s; import java.util.Calendar; public class Main { public static String convertToAge(String age) { String[] dates = age.split("-"); int year = Integer.parseInt(dates[0]); int currentYear = Calendar.getInstance().get(Calendar.YEAR); return (currentYear - year) + ""; } }