Android Date String Parse GetDate(String time)

Here you can find the source of GetDate(String time)

Description

Get Date

Declaration

public static Date GetDate(String time) 

Method Source Code

//package com.java2s;
import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static Date GetDate(long milliseconds) {
        return new Date(milliseconds);
    }/*ww w. j  a  v  a 2  s  .  c o m*/

    public static Date GetDate(String time) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        try {
            return sdf.parse(time);
        } catch (ParseException e) {
            return new Date();
            // e.printStackTrace();
        }
    }
}

Related

  1. String2Date(String dateStr)
  2. changeDateWithSplit(String argDate, String split)
  3. isValidDate(String sDate)
  4. getDateTimeFromString(String dateTimeString, String format)
  5. convertStringToDate(String date, String time)
  6. dateTimeToDateObj(String date, String time)
  7. fromSlDateTime(final String dateString, final String timeString)
  8. convertTimeStumpToDate(String time)
  9. convertimeStumpToDate2(String time)