Here you can find the source of strChangeToDate(String str)
Parameter | Description |
---|---|
str | a parameter |
public static Date strChangeToDate(String str)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date strChangeToDate(String str) { Date date = null;//from w w w .ja v a2 s.c o m try { SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:SS"); date = sd.parse(str); } catch (Exception e) { e.printStackTrace(); } return date; } }