List of utility methods to do Hour Format
String | formatDuration(long duration) format Duration SimpleDateFormat format = new SimpleDateFormat("HH:mm:ss:SSS"); format.setTimeZone(TimeZone.getTimeZone("GMT")); return format.format(new Date(duration)); |
String | formatDuration(long value) format Duration if (twoDigitFormat == null || oneDigitFormat == null) { oneDigitFormat = new DecimalFormat("0"); twoDigitFormat = new DecimalFormat("00"); long[] divisors = { 1000, 60, 60, 24 }; double[] result = new double[divisors.length]; for (int i = 0; i < divisors.length; i++) { result[i] = value % divisors[i]; ... |
String | formateDataC(Date date) formate Data C if (date == null) { return null; try { SimpleDateFormat format = new SimpleDateFormat(DATE_FORMAT_D, Locale.US); return format.format(date); } catch (Exception e) { return null; |
String | formateDate(Date date) formate Date return formateDate(date, BASE_PATTERN);
|
String | formateDate(Date date, String format) formate Date if (date == null) { return ""; SimpleDateFormat dateFormat = new SimpleDateFormat(format); return dateFormat.format(date); |
Date | forMateDate(String dateStr) for Mate Date Date date = null; try { String pattern = "EEE, dd MMM yyyy HH:mm:ss z"; SimpleDateFormat format = new SimpleDateFormat(pattern, Locale.US); date = format.parse(dateStr); return date; } catch (Exception e) { e.printStackTrace(); ... |
String | formateDaTime(Date date) formate Da Time return dateToString(date, patternD);
|
String | formateEndTimeString(String time) formate End Time String return formateTimeString(time, "end"); |
Date | formatEndTime(String datePre) format End Time if (datePre == null) return null; String dateStr = addDateEndfix(datePre); return getFormatDateTime(dateStr); |
Date | formatFF(String date) format FF SimpleDateFormat sdf = new SimpleDateFormat(FORMAT_STYLE_F); try { if (null != date && !"".equals(date)) { return sdf.parse(date); } catch (ParseException e) { e.printStackTrace(); return null; |