Java Integer Format formatIntoHHMMSS(long l)

Here you can find the source of formatIntoHHMMSS(long l)

Description

format Into HHMMSS

License

Open Source License

Declaration

public static String formatIntoHHMMSS(long l) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String formatIntoHHMMSS(long l) {

        long hours = l / 3600, remainder = l % 3600, minutes = remainder / 60, seconds = remainder % 60;

        return ((hours < 10 ? "0" : "") + hours + "h" + (minutes < 10 ? "0" : "") + minutes + "m"
                + (seconds < 10 ? "0" : "") + seconds + "s");
    }//w  w  w . j av  a2s. c o m
}

Related

  1. formatIntegerBase2WithLeadingZeros(long x, int length)
  2. formatIntegerWithLeadingZeros(long x, int radix, int length)
  3. formatIntents(String[] intents)
  4. formatInterval(long interval)
  5. formatIntoHHMMSS(int secsIn)
  6. formatIntOrLong(long v)
  7. formatInts(int[] vals)
  8. formatIntWithPadding(int value, int length, char pad)