Skip to content

Instantly share code, notes, and snippets.

View functionoffunction's full-sized avatar
🖖
live long and prosper

Timi functionoffunction

🖖
live long and prosper
View GitHub Profile
anonymous
anonymous / gist.java
Created December 20, 2014 02:21
Helper methods for JSON parsing
/* The date/time conversion code is going to be moved outside the asynctask later,
* so for convenience we're breaking it out into its own method now.
*/
private String getReadableDateString(long time){
// Because the API returns a unix timestamp (measured in seconds),
// it must be converted to milliseconds in order to be converted to valid date.
SimpleDateFormat shortenedDateFormat = new SimpleDateFormat("EEE MMM dd");
return shortenedDateFormat.format(time);
}