List of utility methods to do Milliseconds Calculate
String[] | millisecondsAfterNearestFifteenMinutes( String date, String time, int milliseconds) milliseconds After Nearest Fifteen Minutes Date d = dateTimeToDateObj(date, time); java.util.Calendar cal = java.util.Calendar.getInstance(); cal.setTime(d); Time msAfter = new Time(); msAfter.set(cal.getTimeInMillis() + milliseconds); msAfter = nearestFifteenMinutes(msAfter); String[] oha = { msAfter.format("%m-%d-%Y"), msAfter.format("%I:%M %p").toUpperCase() }; ... |
String[] | millisecondsAfter(String date, String time, int milliseconds) milliseconds After Date d = dateTimeToDateObj(date, time); java.util.Calendar cal = java.util.Calendar.getInstance(); cal.setTime(d); Time msAfter = new Time(); msAfter.set(cal.getTimeInMillis() + milliseconds); String[] oha = { msAfter.format("%m-%d-%Y"), msAfter.format("%I:%M %p").toUpperCase() }; return oha; ... |
CharSequence | formatDuration(final Resources res, final long millis) Return given duration in a human-friendly format. if (millis >= HOUR_IN_MILLIS) { final int hours = (int) ((millis + 1800000) / HOUR_IN_MILLIS); return res.getQuantityString(R.plurals.duration_hours, hours, hours); } else if (millis >= MINUTE_IN_MILLIS) { final int minutes = (int) ((millis + 30000) / MINUTE_IN_MILLIS); return res.getQuantityString(R.plurals.duration_minutes, minutes, minutes); ... |
long | getMillisPerUnit(int unit) Returns the number of milliseconds of a Calendar field, if this is a constant value. long result = Long.MAX_VALUE; switch (unit) { case Calendar.DAY_OF_YEAR: case Calendar.DATE: result = MILLIS_PER_DAY; break; case Calendar.HOUR_OF_DAY: result = MILLIS_PER_HOUR; ... |
long | getUTCTimeMillis() get UTC Time Millis return getUTCTimeFromLocalMillis(System.currentTimeMillis());
|
long | getTimeZoneOffsetInMillis() get Time Zone Offset In Millis Calendar cal = Calendar.getInstance();
return cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET);
|
int | roundMicrosToMillis(String micros) round Micros To Millis assert micros != null && micros.length() == 4; double dblMicros = Integer.valueOf(micros).doubleValue(); return (int) Math.round(dblMicros / 10.0); |
long | currentDateMillis() current Date Millis return Calendar.getInstance().getTimeInMillis();
|