/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package DateConvert;

import java.sql.Timestamp;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.Date;




public class DateConversion {
     public Timestamp convertToDate(String strtodate)
    {
            SimpleDateFormat sdf=new SimpleDateFormat("dd-MM-yyyy");
            Date date=sdf.parse(strtodate,new ParsePosition(0));
            Timestamp tsp=new Timestamp(date.getTime());
            return tsp;
    }
     public String converToString(Timestamp tsp)
     {
         SimpleDateFormat sdf=new SimpleDateFormat("dd-MM-yyyy");
         Date date=new Date(tsp.getTime());
	 String date1=sdf.format(date);
         return date1;
     }

}
