List of utility methods to do Long to Date Convert
String | millisToLongDHMS(long duration) converts time (in milliseconds) to human-readable format " StringBuffer res = new StringBuffer(); long temp = 0; if (duration >= ONE_SECOND) { temp = duration / ONE_DAY; if (temp > 0) { duration -= temp * ONE_DAY; res.append(temp).append(" day").append(temp > 1 ? "s" : "") .append(duration >= ONE_MINUTE ? ", " : ""); ... |
String | millisToShortDHMS(long duration) converts time (in milliseconds) to human-readable format " String res = ""; duration /= ONE_SECOND; int seconds = (int) (duration % SECONDS); duration /= SECONDS; int minutes = (int) (duration % MINUTES); duration /= MINUTES; int hours = (int) (duration % HOURS); int days = (int) (duration / HOURS); ... |
Date | nextDate(long timeMilliSeconds) next Date return nextDate(new Date(timeMilliSeconds)); |
String | parseMills2Time(long elapsedMills) parse Mills Time return parseInt2Time(Integer.parseInt(elapsedMills + "")); |
String | shortFromUtc(long milliseconds) Convert to "HH:mm:ss" Date date = dateFromUtc(milliseconds); synchronized (HOURS_MINUTES_SECONDS) { return HOURS_MINUTES_SECONDS.format(date); |
String | timeInMillisToText(final long totalTimeInMillis) time In Millis To Text final long minutes = (totalTimeInMillis / (1000 * 60)) % 60; final long hours = totalTimeInMillis / (1000 * 60 * 60); final String hoursWord = getHoursWord(Long.valueOf(hours) .intValue()); final String minutesWord = getMinutessWord(Long.valueOf(minutes) .intValue()); return hours + " " + hoursWord + ", " + minutes + " " + minutesWord; |
String | timeInMillisecondsToDateStringFull( long timeInMilliseconds) time In Milliseconds To Date String Full SimpleDateFormat formatter = new SimpleDateFormat( DEFAULT_FORMAT_PATTERN); Date date = timeInMillisecondsToDate(timeInMilliseconds); formatter.format(date); return formatter.format(date); |
Date | timestampToDate(long timeStamp) timestamp To Date return new java.util.Date(timeStamp * 1000); |
Date | timestampToDate(long timeStamp) timestamp To Date return new java.util.Date(timeStamp * 1000); |
String | timestampToISO8601(long aTime) timestamp To ISO return timestampToISO8601(new Date(aTime)); |