List of utility methods to do Long to Date Convert
CharSequence | formatDateD(Context paramContext, long paramLong) format Date D return android.text.format.DateFormat.format("E", new Date( paramLong)); |
String | formatTimeStampString(Context context, long when, boolean fullFormat) format Time Stamp String Time then = new Time(); then.set(when); Time now = new Time(); now.setToNow(); int format_flags = DateUtils.FORMAT_CAP_NOON_MIDNIGHT | DateUtils.FORMAT_CAP_AMPM; if (then.year != now.year) { format_flags |= DateUtils.FORMAT_SHOW_YEAR ... |
ArrayList | getDatesStartingFromToWithInterval( long startDate, long endDate, int dayInterval) Return un ArrayList of Date objects from the starting date at the end date using the interval time from a date and the next one ArrayList<Date> dates = new ArrayList<Date>(); Date date = new Date(startDate); while ((date = addDays(date, dayInterval)).getTime() <= endDate) { dates.add(date); return dates; |
String | getFormatDateString(String format, long date) get Format Date String java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat( format); return sdf.format(new java.util.Date(date)); |
String | getLongFriendlyDate(long timeInMillis) get Long Friendly Date return getLongFriendlyDate(new Date(timeInMillis)); |
String | getShortFriendlyDate(long timeInMillis) get Short Friendly Date return getShortFriendlyDate(new Date(timeInMillis)); |
String | getTimeStringFrom(long timestamp) get Time String From if (timestamp <= 0) return ""; Date date = new Date(timestamp); SimpleDateFormat formatter = new SimpleDateFormat("HH:mm", Locale.getDefault()); return formatter.format(date); |
String | humanFriendlyDate(long time) human Friendly Date Date today = new Date(); Long duration = today.getTime() - time; int second = 1000; int minute = second * 60; int hour = minute * 60; int day = hour * 24; if (duration < minute) { int n = (int) Math.floor(duration / second); ... |
String | longToDate(long timestamp) long To Date SimpleDateFormat sfd = new SimpleDateFormat("yyyy-MM-dd"); Date date1 = new Date(timestamp); return sfd.format(date1); |
String | millToDate(Long mill) mill To Date SimpleDateFormat sfd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date date1 = new Date(mill); return sfd.format(date1); |