Java String to Date stringToDateMetaData(String dateString)

Here you can find the source of stringToDateMetaData(String dateString)

Description

String to date meta data.

License

Apache License

Parameter

Parameter Description
dateString the date string

Exception

Parameter Description
ParseException the parse exception

Return

the date

Declaration

public static Date stringToDateMetaData(String dateString) throws ParseException 

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 {
    /**//from  www .j a  va 2  s  .  c  om
     * String to date meta data.
     *
     * @param dateString the date string
     * @return the date
     * @throws ParseException the parse exception
     */
    public static Date stringToDateMetaData(String dateString) throws ParseException {

        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss.S");

        try {
            return sdf.parse(dateString);
        } catch (NullPointerException ex) {
            return null;
        } catch (ParseException ex) {
            return null;
        }
    }
}

Related

  1. StringToDateByFormat(String dateStr, String formatStr)
  2. StringToDateByformat1(String time)
  3. stringToDateForIng(String date_str)
  4. StringToDateFormat(String str, String format)
  5. stringToDateInTimeZone(String time, String timeZone)
  6. stringToDateTemporalCoverage(String dateString)
  7. stringToDatetime(String str, String format)
  8. stringToDatetime(String string)
  9. stringToDateTime(String stringDate, String format)