Java Minute Convert convertOffsetToMinutesSecondsMillis(int offset)

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

Description

convert Offset To Minutes Seconds Millis

License

Apache License

Declaration

static public String convertOffsetToMinutesSecondsMillis(int offset) 

Method Source Code

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

public class Main {
    static public String convertOffsetToMinutesSecondsMillis(int offset) {
        int millis = offset;
        int seconds = (int) (millis / 1000);
        int minutes = seconds / 60;
        String strMillis = new String();
        String strSeconds = new String();
        String strMinutes = new String();
        millis = millis - (seconds * 1000);
        seconds = seconds - (minutes * 60);
        if (millis < 10) {
            strMillis = "00" + millis;
        } else if (millis < 100) {
            strMillis = "0" + millis;
        } else {/*from   w w  w  .  j a  va2  s  . c  o m*/
            strMillis = "" + millis;
        }
        if (seconds < 10) {
            strSeconds = "0" + seconds;
        } else {
            strSeconds = "" + seconds;
        }
        strMinutes = "" + minutes;
        return (strMinutes + ":" + strSeconds + ":" + strMillis);
    }
}

Related

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