Java String to Date toDate(String dateToDatify)

Here you can find the source of toDate(String dateToDatify)

Description

Creer une date GMT

License

Apache License

Parameter

Parameter Description
dateToDatify a parameter

Declaration

public static Date toDate(String dateToDatify) 

Method Source Code


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

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

public class Main {
    private static SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");

    /**/*from w w w .ja  v a  2 s.  c  o m*/
     * Creer une date GMT
     * 
     * @param dateToDatify
     * @return
     */
    public static Date toDate(String dateToDatify) {
        try {
            return sdf.parse(dateToDatify);
        } catch (ParseException e) {
            return null;
        }
    }
}

Related

  1. toDate(String dateString, Locale locale)
  2. toDate(String dateString, String dateFormatPattern)
  3. toDate(String dateString, String format)
  4. toDate(String datetime)
  5. toDate(String dateToConvert)
  6. toDate(String dateValue, String format)
  7. toDate(String format, String str)
  8. toDate(String formatDate, String stringDate)
  9. toDate(String param)