Java Utililty Methods Second Convert

List of utility methods to do Second Convert

Description

The list of methods to do Second Convert are organized into topic(s).

Method

longconvertDaysInMiliseconds(long lDays)
Get the number of milliseconds in a given number of days
return CONSTANT_NUMBER_MILISECONDS_IN_DAY * lDays;
intconvertMilisecondsRemainderToFrames(Integer miliseconds, int fps)
Convert frames to miliseconds.
int retObj = 0;
if (miliseconds != null) {
    retObj = (miliseconds % 1000) / (1000 / fps);
return retObj;
StringconvertMilisecondsToDisplay(Integer milliseconds, int fps)
Convert miliseconds to display (00:00:00:00)
String retObj = "";
int hour = (int) ((milliseconds / (1000 * 60 * 60)) % 24);
int minutes = ((milliseconds / (1000 * 60)) % 60);
int seconds = (int) (milliseconds / 1000) % 60;
int frames = convertMilisecondsRemainderToFrames(milliseconds, fps);
retObj += hour < 10 ? "0" + hour : hour;
retObj += ":" + (minutes < 10 ? "0" + minutes : minutes);
retObj += ":" + (seconds < 10 ? "0" + seconds : seconds);
...
floatconvertMsToFloatSeconds(final long timeMs)
convert Ms To Float Seconds
return (float) timeMs / MS_IN_SECOND;
StringconvertSeconds(String sStartSeconds, String sEndSeconds)
Convert the seconds into format like: 00:00:08,200 --> 00:00:12,200
double dStartSeconds = Double.parseDouble(sStartSeconds);
double dEndSeconds = Double.parseDouble(sEndSeconds);
return String.format("%s --> %s", innerConvert(dStartSeconds), innerConvert(dEndSeconds));
doubleconvertSecondsToDays(double secs)
Converts a value in seconds into days
return (((secs / 60.0) / 60.0) / 24.0);
doubleconvertSecondsToMiliseconds(double seconds)
convert Seconds To Miliseconds
return seconds * 1000;
intconvertSecondsToMiliseconds(int secondsToConvert)
converts a given time from seconds -> miliseconds
return secondsToConvert * 1000;
longconvertSecondsToMillies(final long seconds)
convert Seconds To Millies
return seconds * SECOND_IN_MILLIES;
StringconvertSecondsToString(double seconds)
convert Seconds To String
return (Math.round(seconds) + " seconds");