Java String to Date strToDate(String date)

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

Description

str To Date

License

Apache License

Declaration

public static Date strToDate(String date) throws ParseException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.ParseException;

import java.util.Date;

public class Main {

    public static Date strToDate(String date) throws ParseException {

        java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyyMMdd");

        java.util.Date d = sdf.parse(date);

        return d;
    }/*  w  w  w .  j av  a2  s.c o m*/
}

Related

  1. stringToDateTime(String stringDate, String format)
  2. stringToDateWithFormat(String stringToConvert, String dateFormat)
  3. strMSShortToDate(String str_date)
  4. strToDate(final String str)
  5. strToDate(String _date, String format)
  6. strToDate(String date)
  7. strToDate(String date, String pattern)
  8. StrToDate(String dateFormat)
  9. strToDate(String dateInString)