List of utility methods to do Timestamp Format
String | friendlyTimestamp(Date date) friendly Timestamp return format(date, friendlyTimestampFormat());
|
SimpleDateFormat | friendlyTimestampFormat() friendly Timestamp Format return new SimpleDateFormat(formatFriendlyTimestamp); |
java.text.SimpleDateFormat | friendlyTimestampFormat() friendly Timestamp Format return new java.text.SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); |
Calendar | getCalendar(String timeStamp, final String dateFormat) Gets the calendar. DateTime dt = new DateTime(DateTimeZone.UTC); Calendar calendar = dt.toCalendar(Locale.ENGLISH); SimpleDateFormat sdf = new SimpleDateFormat(DATE_FMT_FULL, Locale.ENGLISH); Date date = sdf.parse(timeStamp); calendar.setTime(date); return calendar; |
long | getEpochTime(String dateTimeStamp, SimpleDateFormat dateFormat) get Epoch Time return getEpochTime(dateTimeStamp, false, dateFormat, 0);
|
SimpleDateFormat | getFormatForTimestamp(final Calendar now, final Calendar timestamp) get Format For Timestamp if (now.get(Calendar.YEAR) != timestamp.get(Calendar.YEAR)) { return new SimpleDateFormat("yyyy-MM-dd\nHH:mm"); if (now.get(Calendar.DAY_OF_YEAR) != timestamp.get(Calendar.DAY_OF_YEAR)) { return new SimpleDateFormat("MM-yy\nHH:mm"); return new SimpleDateFormat("HH:mm"); |
Date | getFormattedDate(String timestamp) get Formatted Date return getDateFormat().parse(timestamp);
|
String | getFormattedDateFromTimestamp(long timestamp) get Formatted Date From Timestamp mCalendar.setTimeInMillis(timestamp);
return mDateFormatDump.format(mCalendar.getTime());
|
String | getFormattedTime(long timestamp, String format) get Formatted Time if (format == null) { format = TIMESTAMP_FORMAT; SimpleDateFormat dateformat = new SimpleDateFormat(format); return dateformat.format(new Date(timestamp)); |
String | getFormattedTimestamp() Gets a properly formatted timestamp. return new SimpleDateFormat(DATEFORMAT_PATTERN, Locale.US).format(new Date()); |