Java Millisecond Format milliSekundsToTime(long millisecond)

Here you can find the source of milliSekundsToTime(long millisecond)

Description

milli Sekunds To Time

License

Apache License

Declaration

private static final long[] milliSekundsToTime(long millisecond) 

Method Source Code

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

public class Main {
    private static final long[] milliSekundsToTime(long millisecond) {
        long[] date = new long[4];
        long oneDay = 24 * 60 * 60 * 1000;
        long oneHour = 60 * 60 * 1000;
        long oneMinute = 60 * 1000;
        long oneSecond = 1000;
        date[0] = Math.abs(millisecond / oneDay);
        millisecond -= (date[0] * oneDay);
        date[1] = Math.abs(millisecond / oneHour);
        millisecond -= (date[1] * oneHour);
        date[2] = Math.abs(millisecond / oneMinute);
        millisecond -= (date[2] * oneMinute);
        date[3] = Math.abs(millisecond / oneSecond);
        return date;
    }/*  w  w  w  .jav a2  s . co  m*/
}

Related

  1. milliseconds2String(long millis)
  2. millisecondsPerTick(final int tps)
  3. milliSecondsSince(long startMillis)
  4. milliSecondsToFormatedString(long timeMillis)
  5. millisecondsToToTimeFormat(long inMs)
  6. millisOf(long timestamp)
  7. millisPerBeat(final float bpm)
  8. millisSince(long from)
  9. millisToDate(long millis, String format)