Java String to Date toDate(String dateString)

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

Description

to Date

License

Open Source License

Declaration

public static Date toDate(String dateString) throws ParseException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;

import java.util.TimeZone;

public class Main {
    public static Date toDate(String dateString) throws ParseException {
        DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
        format.setTimeZone(TimeZone.getTimeZone("UTC"));
        return format.parse(dateString);
    }//from  ww w .j  a  v a 2  s.c o m
}

Related

  1. toDate(String dateStr)
  2. toDate(String dateStr, String format)
  3. toDate(String dateStr, String pattern)
  4. toDate(String dateString)
  5. toDate(String dateString)
  6. toDate(String dateString, Locale locale)
  7. toDate(String dateString, String dateFormatPattern)
  8. toDate(String dateString, String format)
  9. toDate(String datetime)