Java Time Format formatTime(int minutes)

Here you can find the source of formatTime(int minutes)

Description

format Time

License

Open Source License

Declaration

private static String formatTime(int minutes) 

Method Source Code

//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";
        }
    }
}

Related

  1. formatTime(final long time)
  2. formatTime(final long time)
  3. formatTime(final long timeMS)
  4. formatTime(float seconds)
  5. formatTime(int minutes)
  6. formatTime(int originalTime)
  7. formatTime(int seconds)
  8. formatTime(int seconds)
  9. formatTime(int seconds)