Java LocalDate Format parseToLocalDate(String format, String date)

Here you can find the source of parseToLocalDate(String format, String date)

Description

parse To Local Date

License

Open Source License

Declaration

public static LocalDate parseToLocalDate(String format, String date) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.time.LocalDate;
import java.time.LocalDateTime;

import java.time.format.DateTimeFormatter;

public class Main {
    public static LocalDate parseToLocalDate(String format, String date) {
        return parseToLocalDate(DateTimeFormatter.ofPattern(format), date);
    }//from  ww w . j  ava2 s .  c  o m

    public static LocalDate parseToLocalDate(DateTimeFormatter formatter, String date) {
        return LocalDate.from(formatter.parse(date));
    }

    public static LocalDateTime parse(String format, String datetime) {
        return parse(DateTimeFormatter.ofPattern(format), datetime);
    }

    public static LocalDateTime parse(DateTimeFormatter formatter, String timestamp) {
        return LocalDateTime.from(formatter.parse(timestamp));
    }
}

Related

  1. getDateFormatForLocalDate()
  2. getDateStartFormat(LocalDate localDate)
  3. getFormattedDateString(LocalDate date)
  4. getLocalDate(String dateStr, String formatStr)
  5. isLocalDate(String value, DateTimeFormatter formatter)