Here you can find the source of getFormatToDateSimple(String yyyyMMdd)
public static Date getFormatToDateSimple(String yyyyMMdd)
//package com.java2s; import java.util.Date; public class Main { public static Date getFormatToDateSimple(String yyyyMMdd) { java.util.Date date = new java.util.Date(); try {/*from www. j a v a 2s . c o m*/ yyyyMMdd = yyyyMMdd.replaceAll("/", "").replaceAll(":", ""); java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyyMMdd"); date = formatter.parse(yyyyMMdd); } catch (Exception e) { return null; } return date; } }