List of utility methods to do LocalDate Format
String | changeLocalDateToFormattedString(LocalDate value) change Local Date To Formatted String if (value == null) return ""; DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy"); String formattedString = value.format(formatter); return formattedString; |
String | dateToString(LocalDate date, DateTimeFormatter formatter) date To String if (date != null) { return formatter.format(date); return null; |
boolean | doesParsedDateMatchText(LocalDate parsedDate, String text, Locale formatLocale) doesParsedDateMatchText, This compares the numbers in a parsed date, to the original text from which the date was parsed. if (parsedDate == null || text == null) { return false; text = text.toLowerCase(); Pattern pattern = Pattern.compile("\\d+"); Matcher matcher = pattern.matcher(text); ArrayList<String> unsignedNumbersFound = new ArrayList<String>(); while (matcher.find()) { ... |
String | format(final LocalDate source) format return DateTimeFormatter.ISO_LOCAL_DATE.format(source);
|
String | formateDate(LocalDate date, String formatStr) formate Date return date.format(DateTimeFormatter.ofPattern(formatStr));
|
Optional | formatLocalDate(LocalDate date) format Local Date if (null == date) { return Optional.empty(); return Optional.of(DEFAULT_DATE_FORMATTER.format(date)); |
String | formatLocalDateJsr310ForJsonPath(LocalDate date) Used to format a LocalDate to the format provided by the Jackson JSR310 Converter Used for jsonPath assertions return "[" + date.getYear() + "," + date.getMonthValue() + "," + date.getDayOfMonth() + "]"; |
String | formatToIsoLocalDate(LocalDate date) format To Iso Local Date return ISO_DATE_FORMATTER.format(date);
|
DateTimeFormatter | getDateFormatForLocalDate() get Date Format For Local Date if (dateTimeFormatter == null) { dateTimeFormatter = DateTimeFormatter.ofPattern(getLocaleDatePattern()); return dateTimeFormatter; |
String | getDateStartFormat(LocalDate localDate) get Date Start Format return localDate.atTime(0, 0, 0).format(DateTimeFormatter.ofPattern(FORMAT_STR_1));
|