Java Parse Date parseDate(String formattedDate)

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

Description

parse Date

License

Apache License

Declaration

public static Date parseDate(String formattedDate) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    private static final String DATE_TIME_PATTERN = "yyyyMMddHHmmssSSS";

    public static Date parseDate(String formattedDate) {
        Date parsedDate = null;//from   w  ww.  j av  a 2s  . c om
        try {
            parsedDate = new SimpleDateFormat(DATE_TIME_PATTERN).parse(formattedDate);
        } catch (Exception e) {
            throw new RuntimeException(
                    "Couldn't parse date: " + formattedDate + " using pattern '" + DATE_TIME_PATTERN + "'.");
        }
        return parsedDate;
    }
}

Related

  1. parseDate(String dateValue, String strFormat)
  2. parseDate(String dttm)
  3. parseDate(String dttm)
  4. parseDate(String format, String value)
  5. parseDate(String formatPattern, String dateStr)
  6. parseDate(String gameDate)
  7. parseDate(String in)
  8. parseDate(String input)
  9. parseDate(String line)