Created
September 28, 2015 02:53
-
-
Save mortenjust/81d2ade21e4fca40e629 to your computer and use it in GitHub Desktop.
Parse date from RSS feed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Date getNewestDateTime(){ | |
String stringDate = getLatestEpisode().getPubDate(); | |
Log.d(TAG, "stringdate is "+stringDate); | |
SimpleDateFormat format = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z", Locale.ENGLISH); | |
try{ | |
Date date = format.parse(stringDate); | |
Log.d(TAG, "parsed date: "+date); | |
return date; | |
} catch(ParseException e) { | |
Log.d(TAG, "parse exception for date"); | |
e.printStackTrace(); | |
} | |
return null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment