Java tutorial
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { /** * time: 2016/10/19 11:42 * description: */ public static Date getData(String time) { SimpleDateFormat myFormatter = new SimpleDateFormat("yyyy-MM-dd"); try { Date parse = myFormatter.parse(time); return parse; } catch (ParseException e) { e.printStackTrace(); } return null; } }