List of utility methods to do Parse Date
Date | parseDate(@Nonnull final String sFormat, @Nonnull final String sValue) parse Date return new SimpleDateFormat(sFormat).parse(sValue); |
Calendar | parseDate(@Nonnull String stringDate) parse Date SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT); Date date = sdf.parse(stringDate); Calendar calendar = Calendar.getInstance(); calendar.setTime(date); return calendar; |
Date | parseDate(@Nullable String value) parse Date return parseDate(value, "yyyy-MM-dd"); |
String | parseDate(Date date) parse Date return sdf.format(date);
|
String | parseDate(Date date) Parses a date and returns a formated date string in the form: "yyyy-MM-dd HH:mm:ss z", where z is the time zone. SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z"); return dateformat.format(date); |
Date | parseDate(Date date) parse Date String format = "dd/mm/yy"; SimpleDateFormat formatter = new SimpleDateFormat(format); return formatter.parse(date.toString()); |
String | parseDate(Date date) Parses a Date to a string using #DATE_STORAGE_FORMAT . if (date == null) { return "never"; return new SimpleDateFormat(DATE_STORAGE_FORMAT, Locale.ENGLISH).format(date); |
String | parseDate(Date date) Return a String for the given java.util.Date as per DATE_FORMAT if (date == null) { return null; SimpleDateFormat formatter = new SimpleDateFormat(DATE_FORMAT); formatter.setLenient(false); return formatter.format(date); |
String | parseDate(Date date) parse Date SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); return sdf.format(date); |
String | parseDate(Date date, int style, Locale local, boolean withTime) parse Date if (date == null) { return null; } else { DateFormat ft = withTime ? DateFormat.getDateTimeInstance(style, style, local) : DateFormat.getDateInstance(style, local); return ft.format(date); |