List of utility methods to do Long Number to Date
String | convert(long number) convert if (number == 0) { return "zero"; String snumber = Long.toString(number); String mask = "000000000000"; DecimalFormat df = new DecimalFormat(mask); snumber = df.format(number); int billions = Integer.parseInt(snumber.substring(0, 3)); ... |
int | convert(long time) convert if (time == Long.MAX_VALUE) { return Integer.MAX_VALUE; if (time == Long.MIN_VALUE) { return Integer.MIN_VALUE; int timeInSec = (int) (time / 1000); return timeInSec - timeZeroInt; ... |
String | convert(long value, double[] factors, String[] unites) convert long sign = value == 0 ? 1 : value / Math.abs(value); int i = 0; double tmp = Math.abs(value); while (i < factors.length && i < unites.length && tmp > factors[i]) { tmp = tmp / factors[i++]; tmp *= sign; String result; ... |
String[] | convert(Long[] targets) convert if (targets == null) { return new String[0]; List<String> list = new ArrayList<String>(); for (Long target : targets) { list.add(target.toString()); return list.toArray(new String[0]); ... |
long | convert2long(String date, String format) convertlong try { SimpleDateFormat sf = new SimpleDateFormat(format); return sf.parse(date).getTime(); } catch (ParseException e) { e.printStackTrace(); return 0l; |
String | convertDate(long datenum) convert Date Date date = new Date(datenum); SimpleDateFormat df = new SimpleDateFormat("MM/dd/yyyy"); return df.format(date); |
String | convertDate(long millisecs) Converts the time from milliseconds to human-readable format SimpleDateFormat date_format = new SimpleDateFormat(flameDateFormat); Calendar c = Calendar.getInstance(); c.setTimeInMillis(millisecs); return date_format.format(c.getTime()); |
String | convertDate(long timestamp) convert Date return new SimpleDateFormat("yyyy-MM-dd").format(new Date(timestamp)); |
String | convertDate(Long uTime, SimpleDateFormat dateFormat) convert Date Date date = new Date(uTime); return dateFormat.format(date); |
String | convertDateFromLong(Long val) convert Date From Long Date date = new Date(val); SimpleDateFormat df2 = new SimpleDateFormat("dd/MM/yy"); String dateText = df2.format(date); return dateText; |