Java Parse Date parseDate(String dateStr)

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

Description

parse Date

License

Open Source License

Declaration

public static long parseDate(String dateStr) throws ParseException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.ParseException;
import java.text.SimpleDateFormat;

public class Main {
    private static SimpleDateFormat simpleDateFormats[];

    public static long parseDate(String dateStr) throws ParseException {
        ParseException pe = null;
        for (SimpleDateFormat simpleDateFormat : simpleDateFormats) {
            try {
                return simpleDateFormat.parse(dateStr).getTime();
            } catch (ParseException e) {
                pe = e;//from w  ww  .  j a  v  a2 s .  co  m
            }
        }
        throw pe;
    }
}

Related

  1. parseDate(String dateFormat, String value)
  2. parseDate(String dateOfString, String targetFormat)
  3. parseDate(String datestr)
  4. parseDate(String dateStr)
  5. parseDate(String dateStr)
  6. parseDate(String dateStr)
  7. parseDate(String dateStr)
  8. parseDate(String dateStr)
  9. parseDate(String dateStr)