Android Date String Parse parseSearchApiDateTime(String dateString)

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

Description

parse Search Api Date Time, "E, d MMM yyyy HH:mm:ss Z"

Declaration

public static final Date parseSearchApiDateTime(String dateString) 

Method Source Code

//package com.java2s;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;
import java.util.Locale;
import android.util.Log;

public class Main {
    private static final String TAG = "DateTimeHelper";
    public static final DateFormat TWITTER_SEARCH_API_DATE_FORMATTER = new SimpleDateFormat(
            "E, d MMM yyyy HH:mm:ss Z", Locale.US);

    public static final Date parseSearchApiDateTime(String dateString) {
        try {// w w  w  .j  a va 2s . c  o m
            return TWITTER_SEARCH_API_DATE_FORMATTER.parse(dateString);
        } catch (ParseException e) {
            Log.w(TAG, "Could not parse Twitter search date string: "
                    + dateString);
            return null;
        }
    }
}

Related

  1. parseDate(final String dateValue, String[] dateFormats)
  2. parseDateStrictly(String str, String... parsePatterns)
  3. parseDateTime(String dateString)
  4. parseDateWithLeniency(String str, String[] parsePatterns, boolean lenient)
  5. parseLongFormat(String dateString)
  6. parseString(String dateStr)
  7. parseString(String dateStr, String pattern)
  8. parseStringToDate(String str)
  9. parseTM(String s, boolean end)