Change the pattern string from "yyyy/MM/DD" to "yyyy/MM/dd"
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
Eg:
String today = "2013/06/25";
SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd");
try {
Date date = formatter.parse(today);
long dateInLong = date.getTime();
System.out.println(date);
System.out.println(dateInLong);
System.out.println(new Timestamp(dateInLong));
} catch (Exception e) {
e.printStackTrace();
}
o/p:
Tue Jun 25 00:00:00 IST 2013
1372098600000
2013-06-25 00:00:00.0