Here you can find the source of parseYoutubeDate(String rawDate)
public static Date parseYoutubeDate(String rawDate)
//package com.java2s; import android.util.Log; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { public static Date parseYoutubeDate(String rawDate) { final String TAG = "StringUtil.parseYoutubeDate"; String pattern = "yyyy-MM-dd HH:mm:ss"; SimpleDateFormat sdf = new SimpleDateFormat(pattern, Locale.US); String minusTimezone = rawDate.substring(0, rawDate.indexOf('.')); String cleanSpecials = minusTimezone.replace('T', ' '); try {//ww w . ja v a 2s. c om return sdf.parse(cleanSpecials); } catch (ParseException pe) { Log.e(TAG, "Error while parsing date: " + cleanSpecials + " with pattern: " + pattern, pe); return null; } } }