Java LocalDate Format formatLocalDateJsr310ForJsonPath(LocalDate date)

Here you can find the source of formatLocalDateJsr310ForJsonPath(LocalDate date)

Description

Used to format a LocalDate to the format provided by the Jackson JSR310 Converter Used for jsonPath assertions

License

LGPL

Parameter

Parameter Description
date a parameter

Declaration

public static String formatLocalDateJsr310ForJsonPath(LocalDate date) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.time.LocalDate;

public class Main {
    /**// w w  w.j a  va  2s.  c  om
     * Used to format a LocalDate to the format provided by the Jackson JSR310 Converter
     * Used for jsonPath assertions
     * @param date
     * @return
     */
    public static String formatLocalDateJsr310ForJsonPath(LocalDate date) {
        return "[" + date.getYear() + "," + date.getMonthValue() + "," + date.getDayOfMonth() + "]";
    }
}

Related

  1. dateToString(LocalDate date, DateTimeFormatter formatter)
  2. doesParsedDateMatchText(LocalDate parsedDate, String text, Locale formatLocale)
  3. format(final LocalDate source)
  4. formateDate(LocalDate date, String formatStr)
  5. formatLocalDate(LocalDate date)
  6. formatToIsoLocalDate(LocalDate date)
  7. getDateFormatForLocalDate()
  8. getDateStartFormat(LocalDate localDate)
  9. getFormattedDateString(LocalDate date)