Android Date String to Date Convert ParseDate(String str)

Here you can find the source of ParseDate(String str)

Description

Parse Date

Declaration

public static Date ParseDate(String str) 

Method Source Code

//package com.java2s;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    public static Date ParseDate(String str) {
        SimpleDateFormat dateFormat = new SimpleDateFormat(
                "yyyy-MM-dd hh:mm:ss");
        Date addTime = null;/*from  ww w .  j ava 2  s  .  c o m*/
        try {
            addTime = dateFormat.parse(str);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return addTime;
    }
}

Related

  1. ParseUTCDate(String str)
  2. formatToDate(String date)
  3. fromStringFR(String dateString)
  4. fromStringUS(String dateString)