Here you can find the source of strToShortday(String s)
public static Date strToShortday(String s)
//package com.java2s; //License from project: Apache License import java.text.ParsePosition; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date strToShortday(String s) { try {//from w w w. ja va 2 s . c om SimpleDateFormat simpledateformat = new SimpleDateFormat("yyyy-MM-dd"); ParsePosition parseposition = new ParsePosition(0); return simpledateformat.parse(s, parseposition); } catch (Exception e) { return null; } } }