Java Parse Date parseDate(String s)

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

Description

parse Date

License

Open Source License

Declaration

public static Date parseDate(String s) 

Method Source Code


//package com.java2s;
// modify it under the terms of the GNU General Public License

import java.text.DateFormat;

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

public class Main {
    private static DateFormat DATE_FORMAT = DateFormat.getDateInstance();

    public static Date parseDate(String s) {
        try {/*from   w  w  w .  j  a v  a2  s . c  o  m*/
            return DATE_FORMAT.parse(s);
        } catch (ParseException e) {
        }
        try {
            if (s != null && s.startsWith("@"))
                return new Date(Long.parseLong(s.substring(1)));
        } catch (IllegalArgumentException iae) {
        }
        return null;
    }
}

Related

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