Java tutorial
//package com.java2s; public class Main { public static String formatDayFromPicker(int day, int month, int year) { String dayS, monthS; month++; if (day < 10) { dayS = "0" + String.valueOf(day); } else { dayS = String.valueOf(day); } if (month < 10) { monthS = "0" + String.valueOf(month); } else { monthS = String.valueOf(month); } return dayS + "/" + monthS + "/" + String.valueOf(year); } }