List of utility methods to do Millisecond Format
String | getFormatedDateTime(long millis) get Formated Date Time return sdf2.format(millis);
|
String | getFormattedAPILastAccessDate(long lastAccessTimeMillis) Get the formatted date string of API Last Access Time DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm"); return dateFormat.format(lastAccessTimeMillis); |
String | getMillisAsFormattedSeconds(long millis) Convert a number of milliseconds into seconds, we format to 2 decimal places, i.e. long secs = millis / 1000; long tenths = (millis - (secs * 1000)) / 100; long hundredths = (millis - (secs * 1000) - (tenths * 100)) / 10; return secs + "." + tenths + hundredths; |
SimpleDateFormat | getMvoDateFormatForMilliSecond() get Mvo Date Format For Milli Second return new SimpleDateFormat("yyyy.MM.dd-HH:mm:ss.SSS"); |
String | getReadableMillis(long startMillis, long endMillis) get Readable Millis StringBuilder sb = new StringBuilder(); double elapsedSeconds = (endMillis - startMillis) / 1000.0; int elapsedSecs = ((int) elapsedSeconds) % 60; int elapsedMinutes = (int) (elapsedSeconds / 60.0); int elapsedMins = elapsedMinutes % 60; int elapsedHrs = elapsedMinutes / 60; int elapsedHours = elapsedHrs % 24; int elapsedDays = elapsedHrs / 24; ... |
String | getReadableMillisTime(long millis) get Readable Millis Time int ms = (int) (millis % 1000); millis /= 1000; int seconds = (int) (millis % 60); millis /= 60; int minutes = (int) (millis % 60); millis /= 60; int hours = (int) (millis % 24); millis /= 24; ... |
String | getTime(long timeInMillis, SimpleDateFormat dateFormat) long time to string return dateFormat.format(new Date(timeInMillis)); |
long | getTimeInMillis(String dateString, String format) get Time In Millis long ts = 0L; try { SimpleDateFormat sdf = new SimpleDateFormat(format); Date date = sdf.parse(dateString); Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.setTimeZone(TimeZone.getTimeZone("UTC")); calendar.set(Calendar.HOUR_OF_DAY, 0); ... |
double | microseconds2milliseconds(double us) microsecondsmilliseconds return 0.001 * us;
|
String | millis2hms(final long t) Convert milliseconds to hours, minutes seconds. if (t < 0) { return "INVALID MILLISECONDS: " + t; if (t < 1000) { return t + "ms"; final long s = (t / 1000) % 60; final long m = ((t / 1000) / 60) % 60; ... |