Java String to Date StringToDate(String date)

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

Description

String To Date

License

Open Source License

Declaration

public static Date StringToDate(String date) 

Method Source Code


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

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

public class Main {
    private final static SimpleDateFormat yyyyMMdd = new SimpleDateFormat("yyyyMMdd");

    public static Date StringToDate(String date) {
        try {//from  w w  w.  ja  v a2 s . co m
            return yyyyMMdd.parse(date);
        } catch (ParseException e) {
        }
        return new Date();
    }
}

Related

  1. stringToDate(String date)
  2. stringToDate(String date)
  3. stringToDate(String date)
  4. stringToDate(String date)
  5. stringToDate(String date)
  6. stringToDate(String date)
  7. stringToDate(String date)
  8. stringToDate(String date, String format)
  9. stringToDate(String date, String pattren)