Class DateTimeFormatters

java.lang.Object
org.springframework.boot.autoconfigure.web.format.DateTimeFormatters

public class DateTimeFormatters extends Object
Formatters for dates, times, and date-times.
Since:
2.3.0
Author:
Andy Wilkinson, Gaurav Pareek
  • Constructor Details

    • DateTimeFormatters

      public DateTimeFormatters()
  • Method Details

    • dateFormat

      public DateTimeFormatters dateFormat(String pattern)
      Configures the date format using the given pattern.
      Parameters:
      pattern - the pattern for formatting dates
      Returns:
      this for chained method invocation
    • timeFormat

      public DateTimeFormatters timeFormat(String pattern)
      Configures the time format using the given pattern.
      Parameters:
      pattern - the pattern for formatting times
      Returns:
      this for chained method invocation
    • dateTimeFormat

      public DateTimeFormatters dateTimeFormat(String pattern)
      Configures the date-time format using the given pattern.
      Parameters:
      pattern - the pattern for formatting date-times
      Returns:
      this for chained method invocation