Here you can find the source of parseDateLong(String date, Locale locale)
Parameter | Description |
---|---|
date | a date in the DateFormat#LONG format. |
locale | a locale. |
Parameter | Description |
---|---|
ParseException | if the date cannot be parsed. |
public static Date parseDateLong(String date, Locale locale) throws ParseException
//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); } }