Java Parse Date parseDate(String dateString)

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

Description

parse Date

License

Open Source License

Declaration

public static Date parseDate(String dateString) 

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 {
    private static DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");

    public static Date parseDate(String dateString) {

        // 2015-04-13T07:56:36.185Z

        format.setTimeZone(TimeZone.getTimeZone("GMT"));

        try {//from   w  ww .  ja v a2s .com
            return format.parse(dateString);
        } catch (ParseException e) {
            return null;
        }
    }
}

Related

  1. parseDate(String dateString)
  2. parseDate(String dateString)
  3. parseDate(String dateString)
  4. parseDate(String dateString)
  5. parseDate(String dateString)
  6. parseDate(String dateString)
  7. parseDate(String dateString)
  8. parseDate(String dateString)
  9. parseDate(String dateString)