Android Date String Parse parseUTCFormattedDateString(String dateString)

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

Description

parse UTC Formatted Date String

Declaration

public static Date parseUTCFormattedDateString(String dateString) 

Method Source Code

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
import android.util.Log;

public class Main{
    public static Date parseUTCFormattedDateString(String dateString) {
        SimpleDateFormat formatter = new SimpleDateFormat(
                "yyyy-MM-dd'T'HH:mm'Z'");
        Date date = null;/*from w  ww .  ja  va  2s .co  m*/
        try {
            date = formatter.parse(dateString);
        } catch (ParseException e) {
            Log.e(DateTimeUtil.class.getSimpleName(),
                    "Failed to parse date");
            e.printStackTrace();
        }
        return date;
    }
}

Related

  1. parseDate(String rawDate)
  2. parseDateStr(String dateStr, String srcPattern, String destPattern)
  3. parseDateString(String dateStr, String pattern)
  4. parseDateString(String dateStr, String pattern, Locale locale)
  5. parseSimpleDate(String dateString)
  6. parseYoutubeDate(String rawDate)
  7. stringToDate(String str)
  8. toDate(String sdate)
  9. toDate(String sdate)