Java String to Date stringDateToDate(String StrDate)

Here you can find the source of stringDateToDate(String StrDate)

Description

string Date To Date

License

Open Source License

Declaration

public static Date stringDateToDate(String StrDate) throws ParseException 

Method Source Code

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

import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    static final String DATEFORMAT = "yyyy-MM-dd";

    public static Date stringDateToDate(String StrDate) throws ParseException {
        Date dateToReturn = null;
        SimpleDateFormat dateFormat = new SimpleDateFormat(DATEFORMAT);

        try {//from  ww  w .  j  av  a  2  s . c om
            dateToReturn = (Date) dateFormat.parse(StrDate);
        } catch (ParseException e) {
            e.printStackTrace();
        }

        return dateToReturn;
    }
}

Related

  1. SortStringToDate(String thisdate, Locale locale)
  2. strChangeToDate(String str)
  3. strDateConvertToDate(String strDate, String fFormatStr)
  4. stringArrayTODateArray(String[] dates_s, SimpleDateFormat dateformat)
  5. stringDateToDate(String str)
  6. stringFechaToDate(String fechaS)
  7. stringToDate(final String dateString)
  8. stringToDate(final String dateTimeStr)
  9. stringToDate(final String str, final String dateFormat)