Here you can find the source of toTimestamp(String source)
public static Date toTimestamp(String source)
//package com.java2s; //License from project: Open Source License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static final String TIMESTAMP_FORMAT = "yyyy/MM/dd HH:mm:ss"; public static Date toTimestamp(String source) { return parse(source, TIMESTAMP_FORMAT); }//from w w w .j ava2 s . c om private static Date parse(String source, String format) { SimpleDateFormat parser = new SimpleDateFormat(format); try { return parser.parse(source); } catch (ParseException e) { throw new RuntimeException(e); } } }