Java tutorial
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { public static Date String2Date(String date) { Date DateTime = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.CHINESE); try { DateTime = sdf.parse(date); } catch (ParseException e) { e.printStackTrace(); } return DateTime; } }