Java LocalDate from String toLocalDate(String date)

Here you can find the source of toLocalDate(String date)

Description

to Local Date

License

Open Source License

Declaration

public static LocalDate toLocalDate(String date) 

Method Source Code

//package com.java2s;
/* // w  w w. j  ava  2  s  . c o m
 * Copyright (C) 2017 GetMangos
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

import java.time.LocalDate;

import java.time.format.DateTimeFormatter;

import java.util.Locale;

public class Main {
    public static LocalDate toLocalDate(String date) {
        DateTimeFormatter format = DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm:ss", Locale.getDefault());
        return LocalDate.parse(date, format);
    }
}

Related

  1. getLocalDateFromString(String sDate)
  2. parseLocalDate(String dateString)
  3. parseLocalDate(String inPattern, String inDate)
  4. parseLocalDate(String localDate)
  5. parseStringToLocalDate(String strDate)
  6. toLocalDate(String date)
  7. toLocalDate(String dateValue)