I need to format my time string such as this:
int time = 160;
Here\'s my sample code:
public static String formatDuration(
Just try
sdf = new SimpleDateFormat("HH 'hrs' mm 'mins'");
There is a good documentation https://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html From the doc:
"Text can be quoted using single quotes (') to avoid interpretation."