Java Parse Date parseDateLong(String date, Locale locale)

Here you can find the source of parseDateLong(String date, Locale locale)

Description

Parses the specified date in the DateFormat#LONG format and locale and returns the Date instance using the system default time zone.

License

MIT License

Parameter

Parameter Description
date a date in the DateFormat#LONG format.
locale a locale.

Exception

Parameter Description
ParseException if the date cannot be parsed.

Return

the Date instance.

Declaration

public static Date parseDateLong(String date, Locale locale) throws ParseException 

Method Source Code

//package com.java2s;
/*/* www.  j  ava2s  . c  om*/
 * Copyright (c) 2015-2016 QuartzDesk.com.
 * Licensed under the MIT license (https://opensource.org/licenses/MIT).
 */

import java.text.DateFormat;

import java.text.ParseException;

import java.util.Date;

import java.util.Locale;

public class Main {
    /**
     * Parses the specified date in the {@link DateFormat#LONG} format and locale
     * and returns the Date instance using the system default time zone.
     *
     * @param date   a date in the {@link DateFormat#LONG} format.
     * @param locale a locale.
     * @return the Date instance.
     * @throws ParseException if the date cannot be parsed.
     */
    public static Date parseDateLong(String date, Locale locale) throws ParseException {
        return DateFormat.getDateInstance(DateFormat.LONG, locale).parse(date);
    }
}

Related

  1. parseDateHeader(String value)
  2. parseDateHHmm(java.util.Date date)
  3. parseDateHHMM(String hhmm)
  4. parseDateHMSMZ(String dateString)
  5. parseDateList(List dateList)
  6. parseDateLongFormat(String sDate)
  7. parseDateLoose(String dateString)
  8. parseDateNewFormat(String sDate)
  9. parseDateNoTimeWithDelimit(String sDate, String delimit)