Java Minute Convert convertOffsetToMinutesSeconds(int offset)

Here you can find the source of convertOffsetToMinutesSeconds(int offset)

Description

Convert a given millisecond offset into mm:ss string format

License

Apache License

Declaration

static public String convertOffsetToMinutesSeconds(int offset) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /**/* w  w  w . jav a  2  s  .  c o m*/
     * Convert a given millisecond offset into mm:ss string format
     */
    static public String convertOffsetToMinutesSeconds(int offset) {
        int seconds = (int) (offset / 1000);
        int minutes = seconds / 60;
        String strSeconds = new String();
        seconds = seconds - (minutes * 60);
        if (seconds < 10) {
            strSeconds = "0" + seconds;
        } else {
            strSeconds = "" + seconds;
        }
        String strMinutes = "" + minutes;
        return (strMinutes + ":" + strSeconds);
    }
}

Related

  1. convertMinutesSecondsToMilliseconds(String offset)
  2. convertMinutesToMilliseconds(final long minutes)
  3. convertMinutesToSeconds(final long minutes)
  4. convertMinutesToSeconds(int minutesToConvert)
  5. convertMsToMinutesAndSeconds(long ms)
  6. convertOffsetToMinutesSecondsMillis(int offset)
  7. convertSecondsToHoursMinutesSeconds(int offset)
  8. convertSecondsToMinutes(double seconds)
  9. convertTicksToMinutesAndSeconds(int ticks, boolean fraction)