Java TimeUnit Usage TimeToString(int ticks)

Here you can find the source of TimeToString(int ticks)

Description

Time To String

License

LGPL

Declaration

public static String TimeToString(int ticks) 

Method Source Code

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

import java.util.concurrent.TimeUnit;

public class Main {
    public static String TimeToString(int ticks) {
        int millis = ticks / 20 * 1000;

        return String.format("%02d:%02d:%02d", TimeUnit.MILLISECONDS.toHours(millis),
                TimeUnit.MILLISECONDS.toMinutes(millis) % TimeUnit.HOURS.toMinutes(1),
                TimeUnit.MILLISECONDS.toSeconds(millis) % TimeUnit.MINUTES.toSeconds(1));
    }//from  w w w .  j  a va 2s.  co m
}

Related

  1. string2Millis(String duration)
  2. string2Millis(String duration)
  3. stringToMillis(String string)
  4. timestampMillis()
  5. timeToHMS(final long time)
  6. toBias(long offset)
  7. todayInMillis()
  8. toDays(Date date)
  9. todayStart()