Here you can find the source of parseStringToLocalDate(String strDate)
Parameter | Description |
---|---|
ParseException | an exception |
public static LocalDate parseStringToLocalDate(String strDate) throws DateTimeParseException
//package com.java2s; //License from project: Open Source License import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; public class Main { public static final DateTimeFormatter localDateFormatter = DateTimeFormatter.ofPattern("d MMM yyyy"); /**/*from w ww . jav a2 s. c om*/ * Parses a String into a LocalDate * @throws ParseException */ public static LocalDate parseStringToLocalDate(String strDate) throws DateTimeParseException { return LocalDate.parse(strDate, localDateFormatter); } }