Java String to Date toDateFormat(String date)

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

Description

Formats an xsd:dateTime to a JAVA object data

License

Open Source License

Parameter

Parameter Description
date - A string extracted from the triple's object

Exception

Parameter Description
ParseException an exception

Return

JAVA object data

Declaration

private static Date toDateFormat(String date) 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 {
    /**// w w  w.  j av  a  2  s. c om
     * Formats an xsd:dateTime to a JAVA object data
     * @param date - A string extracted from the triple's object
     * @return JAVA object data
     * 
     * @throws ParseException
     */
    private static Date toDateFormat(String date) throws ParseException {
        SimpleDateFormat sdf = new SimpleDateFormat(
                "yyyy-MM-dd'T'hh:mm:ss.SSS'Z'");
        return sdf.parse(date);
    }
}

Related

  1. toDate(String ts)
  2. toDate(String value)
  3. toDateByFormat(String dateString, String formatStr)
  4. toDateByPattern(String dateTime)
  5. toDateFormat(Integer grain, TimeZone timeZone, String dateFormatArg)
  6. toDateFormat(String dateFormat, TimeZone tz, Locale locale)
  7. toDateOracle(Date d, String format, String hqlFormat)
  8. toDates(DateFormat format, String[] values)
  9. toDateString(Calendar cal)