Java tutorial
//package com.java2s; import android.text.TextUtils; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public final static SimpleDateFormat dateTimeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm"); public static Date getDateTime(String date) { Date originalReleaseDate = null; try { if (!TextUtils.isEmpty(date)) { originalReleaseDate = dateTimeFormat.parse(date); } } catch (ParseException e) { e.printStackTrace(); } return originalReleaseDate; } }