Here you can find the source of parse(String param)
Parameter | Description |
---|---|
param | datetime string, pattern: "yyyy-MM-dd HH:mm:ss". |
public static Date parse(String param)
//package com.java2s; //License from project: Apache License import java.util.Date; import java.text.SimpleDateFormat; import java.text.ParseException; public class Main { /**//from w w w.j a v a 2 s. co m * Parse a datetime string. * * @param param * datetime string, pattern: "yyyy-MM-dd HH:mm:ss". * @return java.util.Date */ public static Date parse(String param) { Date date = null; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try { date = sdf.parse(param); } catch (ParseException e) { } return date; } }