List of utility methods to do Timestamp Format
String | toReadableTime(Long timestamp, String format) to Readable Time SimpleDateFormat sdf = new SimpleDateFormat(format); sdf.setTimeZone(TimeZone.getDefault()); if (timestamp == null) timestamp = System.currentTimeMillis(); return sdf.format(new Date(timestamp)); |
long | toTimeStamp(String dateTime, SimpleDateFormat format, int timeZoneOffset) Convert a string to a time stamp using the same algorithm as the Aerospike loader. Date formatDate = format.parse(dateTime); long miliSecondForDate = formatDate.getTime() - timeZoneOffset; return miliSecondForDate / 1000; |
Long | unixTimestamp(String date, String dateFormat) unix Timestamp return new Long(parseDate(date, dateFormat).getTime() / 1000); |