Here you can find the source of getLocalDateForString(final String string)
Parameter | Description |
---|---|
string | Datum-Wert |
public static LocalDate getLocalDateForString(final String string)
//package com.java2s; /*//from w w w .j a va 2 s . co m * Copyright 2014-2015 Christian Raue * MIT License http://opensource.org/licenses/mit-license.php */ import java.time.LocalDate; import java.time.format.DateTimeFormatter; public class Main { private static final String PATTERN_DATE = "dd.MM.yyyy"; /** * @param string Datum-Wert * @return {@link LocalDate}-Objekt mit entsprechendem Datum-Wert */ public static LocalDate getLocalDateForString(final String string) { return LocalDate.parse(string, DateTimeFormatter.ofPattern(PATTERN_DATE)); } }