Inspectopedia Help

Incorrect 'DateTimeFormat' pattern

Reports incorrect date time format patterns.

The following errors are reported:

  • Unsupported pattern letters, like "TT"

  • Using reserved characters, like "#"

  • Incorrect use of padding

  • Unbalanced brackets

  • Incorrect amount of consecutive pattern letters


DateTimeFormatter.ofPattern("[][]]"); // Closing ']' without previous opening '[' DateTimeFormatter.ofPattern("TT"); // Illegal pattern letter 'T' DateTimeFormatter.ofPattern("{"); // Use of reserved character '{' DateTimeFormatter.ofPattern("MMMMMM"); // Too many consecutive pattern letters 'M'

New in 2022.3

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3


Java, 233.SNAPSHOT

Last modified: 13 July 2023