Java String to Time getAsDateTime(String dateTime)

Here you can find the source of getAsDateTime(String dateTime)

Description

get As Date Time

License

Open Source License

Declaration

public static Date getAsDateTime(String dateTime) 

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 {
    private static final String FORMAT = "yyyy-MM-dd'T'HH:mm:ss'Z'";

    public static Date getAsDateTime(String dateTime) {
        try {//from w  ww. j  a  v  a 2 s. com
            return new SimpleDateFormat(FORMAT).parse(dateTime);
        } catch (ParseException e) {
            throw new IllegalArgumentException(e);
        }
    }
}

Related

  1. getCalendarForSpecifiedDate(final String dateTime)
  2. getCalendarFromCPEGeneratorDateTime(String cpeDateTime)
  3. getCalendarFromDate(final String dateTime)
  4. getDlayDateTime(String playDate, String playTime)