Java Parse Date Pattern YYYY parse(String stringData)

Here you can find the source of parse(String stringData)

Description

parse

License

Open Source License

Declaration

public static Date parse(String stringData) 

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;

public class Main {
    public static Date parse(String stringData) {
        final DateFormat fmt;
        if (stringData.endsWith("Z")) {
            fmt = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
        } else {//from   www  .  j  a v a2  s.  com
            fmt = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
        }
        try {
            return fmt.parse(stringData);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return null;
    }
}

Related

  1. parse(String str)
  2. parse(String strDate)
  3. parse(String strDate)
  4. parse(String string)
  5. parse(String string)
  6. parse(String text)
  7. parse(String text)
  8. parse(String time)
  9. parse(String time, String df)