List of utility methods to do Date to String Convert
String | getStringFromDate(Date date) get String From Date, "EEE MMM dd HH:mm:ss ZZZZZ yyyy" return sf.format(date);
|
String | javaDateToIso8601(Date date) java Date To Iso if (date == null) return ""; DateFormat formatter = ISO8601Format.get(); return formatter.format(date); |
String | javaDateToTimeSpan(final Date date) java Date To Time Span if (date == null) return ""; long passedTime = date.getTime(); long currentTime = System.currentTimeMillis(); long secondsSince = (currentTime - passedTime) / 1000; if (secondsSince < 60) return WordPress.getContext().getString( R.string.reader_timespan_now); ... |
Date | toGMTDate(Date localDate) to GMT Date return new Date(); |
String | toString(Date date) to String if (date == null) return ""; SimpleDateFormat lv_formatter; lv_formatter = new SimpleDateFormat(kSimpleDateFormat); lv_formatter.setTimeZone(TimeZone.getTimeZone("UTC")); return lv_formatter.format(date); |
String | getStrFromDate(Date date) get Str From Date Date curDate = date; SimpleDateFormat sdf; sdf = new SimpleDateFormat("yyyy-MM-dd"); today = sdf.format(curDate); return today; |
String | dateToString(Date date) date To String return dateToString(DEFAULT_DATE_FORMAT, date);
|
String | dateToString(String format, String date) date To String long time = getTimeInMillis(date); calendar.clear(); calendar.setTimeInMillis(time); return dateToString(format, calendar.getTime()); |
String | dateToString(String format, Date date) date To String SimpleDateFormat dateFormat = new SimpleDateFormat(format); return dateFormat.format(date); |
String | dateToString(Date time) date To String, "yyyy-MM-dd HH:mm:ss" SimpleDateFormat formatter; formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String ctime = formatter.format(time); return ctime; |