Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { public static Date getDate(String dateTime) { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd", Locale.getDefault()); Date date = null; try { date = dateFormat.parse(dateTime); } catch (Exception e) { e.printStackTrace(); } return date; } }