List of utility methods to do Milliseconds
long | getMillis(long timeInMinutes) get Millis return timeInMinutes * 60 * 1000;
|
long | getMillis(String _cal) get Millis int idx1 = _cal.indexOf("time"); int idx2 = _cal.indexOf(","); return Long.parseLong(_cal.substring(idx1 + 5, idx2)); |
int | getMillis(String dateStr) Returns the milli second part of the datetime. int length = dateStr.length(); if (length == 19) { return 0; } else if (length == 21) { return Integer.parseInt(dateStr.substring(20)) * 100; } else if (length == 22) { return Integer.parseInt(dateStr.substring(20)) * 10; } else if (length >= 23 && length <= 26) { ... |
int | getMillis(String decimal) Gets the number of millis represented by a String containing a decimal(8,3) type.
boolean isNegative; if (decimal.length() > 0 && decimal.charAt(0) == '-') { isNegative = true; decimal = decimal.substring(1); } else isNegative = false; if (decimal.length() > 0 && decimal.charAt(0) == '.') decimal = '0' + decimal; ... |
String | getMillisDisplayable(long millis) get Millis Displayable String result = null; final long second = 1000; final long minute = 60 * second; if (millis % minute == 0) { long minutes = millis / minute; if (minutes == 1) { result = minutes + " minute"; } else { ... |
long | getMilliSecond(Date d1, Date d2) get Milli Second long d1MS = d1.getTime(); long d2MS = d2.getTime(); return Math.abs(d1MS - d2MS); |
int | getMillisecond(Date date) get Millisecond calendar.setTime(date);
return calendar.get(Calendar.MILLISECOND);
|
int | getMillisecond(String forDate) get Millisecond return Integer.parseInt(forDate.substring(20, 23));
|
long | getMilliSecondBetween(long start, long end) get Milli Second Between return (end - start) / (1000 * 1000);
|
Long | getMillisecondDay() get Millisecond Day return MILLISECOND_DAY;
|