List of usage examples for android.text.format Time toString
@Override
public String toString()
From source file:org.cinedroid.tasks.impl.RetrievePerformancesTask.java
/** * Removes any times which have passed from the list * /*from ww w . j a v a 2s .c o m*/ * @param results */ private void filterPastDates(final FilmDate filmDate) { Time currentTime = new Time(); currentTime.setToNow(); Time performanceDate = new Time(); String date = filmDate.getDate(); performanceDate.parse(date); // Check if the performance date is before the current time. This will only be true in the situation that the filmDate represents // the current day, as the cineworld api does not return dates which have passed. If the object is the current date, the film // performances need filtering. if (currentTime.after(performanceDate)) { for (Iterator<FilmPerformance> i = filmDate.getPerformances().iterator(); i.hasNext();) { String time = i.next().getTime().replace(":", ""); // Get the time with the : removed. performanceDate.parse(String.format("%sT%s00", date, time)); Log.d(TAG, String.format("Checking %s", performanceDate.format("%d %b %H:%M"))); if (currentTime.after(performanceDate)) { Log.d(TAG, String.format("Removed %s", performanceDate.format("%d %b %H:%M"))); i.remove(); } } } Log.d(TAG, String.format("Current Time %s", currentTime.toString())); }