Here you can find the source of parseDatabaseDate(String dateString)
public static String parseDatabaseDate(String dateString) throws ParseException
//package com.java2s; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String parseDatabaseDate(String dateString) throws ParseException { String oldScheduledDate = dateString.replaceAll("/", "-"); DateFormat oldFormatter = new SimpleDateFormat("dd-MM-yyyy"); DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); Date oldDate = (Date) oldFormatter.parse(oldScheduledDate); return formatter.format(oldDate); }// w ww. jav a 2 s . c om }