timeframe strings
This commit is contained in:
parent
7d82870203
commit
9e8752b096
|
@ -146,4 +146,20 @@ public class DateUtil {
|
|||
}
|
||||
|
||||
|
||||
public static String timeFrameString(long timeInMillis){
|
||||
long remainingTimeMinutes = timeInMillis/(1000*60);
|
||||
long remainingTimeHours = remainingTimeMinutes/60;
|
||||
remainingTimeMinutes = remainingTimeMinutes%60;
|
||||
return "(" + ((remainingTimeHours >0)?(remainingTimeHours + "h "):"") + remainingTimeMinutes + "')";
|
||||
}
|
||||
|
||||
public static String sinceString(long timestamp){
|
||||
return timeFrameString(System.currentTimeMillis()-timestamp);
|
||||
}
|
||||
|
||||
public static String untilString(long timestamp){
|
||||
return timeFrameString(timestamp- System.currentTimeMillis());
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in a new issue