Android ISO Format to Date Convert isoDateStringToDate(String dateString)

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

Description

Converts an ISO-formatted String representation of a date to a Date object.

Return

a object corresponding to given date string

Declaration

public static Date isoDateStringToDate(String dateString)
        throws ParseException 

Method Source Code

//package com.java2s;
import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    /**//from   w  w w  . ja v a2  s  .c om
     * Converts an ISO-formatted {@link String} representation of a date to a {@link Date} object.
     *
     * @return  a {@link Date} object corresponding to given date string
     * @see     #dateToIsoDateString(Date)
     * @see     #dateToIsoDateString(Date, DateFallback)
     */
    public static Date isoDateStringToDate(String dateString)
            throws ParseException {
        return new SimpleDateFormat("yyyy-MM-dd HH:mm").parse(dateString);
    }
}

Related

  1. fromIso8601(String date)
  2. iso8601ToJavaDate(final String strDate)
  3. iso8601ToJavaDate(final String strDate)