Java tutorial
import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static void main(String[] args) throws Exception { String source = new String("03/20/2015"); SimpleDateFormat sdfinput = new SimpleDateFormat("MM/dd/yyyy"); SimpleDateFormat sdfoutput = new SimpleDateFormat("yyyy-MM-dd"); Date inputdate = sdfinput.parse(source); String outputDate = sdfoutput.format(inputdate); System.out.println(outputDate); } }