get Date From String in format dd/MM/yyyy - Java java.time

Java examples for java.time:Format

Description

get Date From String in format dd/MM/yyyy

Demo Code


//package com.java2s;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

public class Main {
    public final static DateTimeFormatter DATE_FORMATTER = DateTimeFormatter
            .ofPattern("dd/MM/yyyy");

    public static LocalDate getDateFromString(String date) {
        return LocalDate.parse(date, DATE_FORMATTER);
    }//from   www  .j  av  a 2 s  . c  o  m
}

Related Tutorials