Java Parse Date parseDate(String sDate)

Here you can find the source of parseDate(String sDate)

Description

parse Date

License

Open Source License

Declaration

public static java.util.Date parseDate(String sDate) 

Method Source Code

//package com.java2s;

public class Main {
    public static java.util.Date parseDate(String sDate) {
        java.text.DateFormat formatter = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        java.util.Date retDate = null;
        try {/*from ww  w.j ava 2 s .  c  o m*/
            retDate = formatter.parse(sDate);
        } catch (Exception ex) {
        }
        return retDate;
    }

    public static java.util.Date parseDate(String sDate, String format) {
        java.text.DateFormat formatter = new java.text.SimpleDateFormat(format);
        java.util.Date retDate = null;
        try {
            retDate = formatter.parse(sDate);
        } catch (Exception ex) {
        }
        return retDate;
    }
}

Related

  1. parseDate(String s)
  2. parseDate(String s)
  3. parsedate(String s, SimpleDateFormat fmt)
  4. parseDate(String s, String format)
  5. parseDate(String sDate)
  6. parseDate(String sDate)
  7. parseDate(String sDate, Locale locale)
  8. parseDate(String sDate, SimpleDateFormat _dateFormat)
  9. parseDate(String sDate, String sFormat)