Java Second Get getSecondsToHHMMSS(double seconds)

Here you can find the source of getSecondsToHHMMSS(double seconds)

Description

get Seconds To HHMMSS

License

Open Source License

Declaration

public static String getSecondsToHHMMSS(double seconds) 

Method Source Code

//package com.java2s;
/*/*from ww  w  .j  a  v  a 2 s . c om*/
 * Copyright (C) 2012-2015, Juan Manuel Barrios <http://juan.cl/>
 * All rights reserved.
 *
 * This file is part of P-VCD. http://p-vcd.org/
 * P-VCD is made available under the terms of the BSD 2-Clause License.
 */

public class Main {
    public static String getSecondsToHHMMSS(double seconds) {
        long seg = Math.round(seconds);
        long hh = seg / 3600;
        seg = seg % 3600;
        long mm = seg / 60;
        seg = seg % 60;
        return (hh < 10 ? "0" : "") + hh + ":" + (mm < 10 ? "0" : "") + mm + ":" + (seg < 10 ? "0" : "") + seg;
    }
}

Related

  1. getSecondsFromString(String text)
  2. getSecondsFromStringDuration(String duration)
  3. getSecondSimpleType(String completeType)
  4. getSecondsInDDHHMMSS(int s)
  5. getSecondsText(long seconds)
  6. getSecondsToMMSS(double seconds)
  7. getSecondTime()
  8. getSecondTime(String time)
  9. getSecondToLastIndexOf(String string, char character)