Here you can find the source of formatTime(int minutes)
private static String formatTime(int minutes)
//package com.java2s; //License from project: Open Source License public class Main { private static String formatTime(int minutes) { int hours = minutes / 60; minutes -= hours * 60;/*w w w .j a v a2 s .co m*/ if (hours == 0) { if (minutes == 0) { return "Saved recently"; } else if (minutes == 1) { return "Saved 1 minute ago"; } else { return "Saved " + minutes + " minutes ago"; } } else if (hours == 1) { return "Saved 1 hour ago"; } else { return "Saved " + hours + " hours ago"; } } }