Java Parse Date Pattern YYYY parseTwitterDate(String theDate)

Here you can find the source of parseTwitterDate(String theDate)

Description

parse Twitter Date

License

Apache License

Declaration

public static Date parseTwitterDate(String theDate) throws ParseException 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.text.ParseException;
import java.util.Date;

public class Main {
    private static java.text.SimpleDateFormat format = new java.text.SimpleDateFormat(
            "EEE, dd MMM yyyy HH:mm:ss Z");

    public static Date parseTwitterDate(String theDate) throws ParseException {
        if (theDate == null || theDate.length() == 0) {
            return null;
        }/*ww w.ja  va 2 s  .co m*/

        synchronized (format) {
            Date createdAt = format.parse(theDate);
            return createdAt;
        }
    }
}

Related

  1. parseToRegExcel(String raw)
  2. parseToString(Date date)
  3. parseToString(Date date, String format)
  4. parseToString(final Date date, final String format)
  5. parseToStringDate(long ms)
  6. parseUserDate(String date)
  7. parseUsGeneralDateTime(Date value)
  8. parseVariuosDateTime(String dateStr)
  9. parseW3CDate(String dateString)