{"record":{"id":"24b6b6e8103014f9","repo":"JetBrains/intellij-community","slug":"unknown-conversion-in-0","errorCode":null,"errorMessage":"unknown conversion in ''{0}''","messagePattern":"unknown conversion in ''(.+?)''","errorType":"exception","errorClass":"FormatDecode.IllegalFormatException","httpStatus":null,"severity":"error","filePath":"java/java-analysis-impl/src/com/siyeh/ig/format/FormatDecode.java","lineNumber":310,"sourceCode":"        if (!previousAllowed) {\n          throw new IllegalFormatException(InspectionGadgetsBundle.message(\"format.string.error.previous.element.not.found\", specifier));\n        }\n      }\n      else {\n        previousAllowed = true;\n        pos = implicit++;\n      }\n\n      final Validator allowed;\n      if (isAllVerifier) {\n        allowed = new AllValidatorWithRange(TextRange.create(matcher.start(), matcher.end()),\n                                            new Spec(posSpec, flags, width, precision, dateSpec, conversion));\n      }\n      else if (dateSpec != null) {  // a t or T\n        checkFlags(flagBits, LEFT_JUSTIFY | PREVIOUS, specifier);\n        DateTimeConversionType dateTimeConversionType = getDateTimeConversionType(conversion.charAt(0));\n        if (dateTimeConversionType == DateTimeConversionType.UNKNOWN) {\n          throw new IllegalFormatException(\n            InspectionGadgetsBundle.message(\"format.string.error.unknown.conversion\", dateSpec + conversion));\n        }\n        checkNoPrecision(precision, specifier);\n        allowed = new DateValidator(specifier, dateTimeConversionType);\n      }\n      else {\n        switch (conversion.charAt(0)) {\n          case 'b', 'B', 'h', 'H' -> { // boolean (general); Integer hex string (general)\n            checkFlags(flagBits, LEFT_JUSTIFY | PREVIOUS, specifier);\n            allowed = ALL_VALIDATOR;\n          }\n          case 's', 'S' -> { // formatted string (general)\n            checkFlags(flagBits, LEFT_JUSTIFY | ALTERNATE | PREVIOUS, specifier);\n            allowed = (flagBits & ALTERNATE) != 0 ? new FormattableValidator(specifier) : ALL_VALIDATOR;\n          }\n          case 'c', 'C' -> { // unicode character\n            checkFlags(flagBits, LEFT_JUSTIFY | PREVIOUS, specifier);\n            checkNoPrecision(precision, specifier);","sourceCodeStart":292,"sourceCodeEnd":328,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/java/java-analysis-impl/src/com/siyeh/ig/format/FormatDecode.java#L292-L328","documentation":"IllegalFormatException from FormatDecode's date/time branch: a '%t'/'%T' conversion whose date suffix character is not a known date/time conversion (getDateTimeConversionType returns UNKNOWN). Date suffixes are letters like H, M, S, Y, m, d, e, a, B, etc. (java.util.Formatter table); anything else, e.g. '%tq', is rejected. The message shows the dateSpec + conversion text.","triggerScenarios":"A specifier '%tX' or '%TX' where X is not in the date/time conversion table; occurs while decoding format strings used with Calendar/Date/Temporal arguments.","commonSituations":"Typos in time formatting ('%tS' seconds vs '%ts' epoch seconds confusion); porting strftime patterns (%H:%M) into java.util.Formatter syntax incorrectly.","solutions":["Use a valid date/time suffix after %t (e.g. %tH hour, %tM minute, %tY year, %td day)","Prefer DateTimeFormatter with converted patterns for complex time formatting","Cross-check against the java.util.Formatter date/time table"],"exampleFix":"// before\nString.format(\"%tq\", cal)\n// after\nString.format(\"%tH\", cal)","handlingStrategy":"validation","validationCode":"private static final String DATE_SUFFIXES = \"HIkMSsLNTzZAaBbCcdehjmGyYQqRstDFEux\"; // java.util.Formatter date/time table\nstatic boolean dateSuffixValid(char c) { return DATE_SUFFIXES.indexOf(c) >= 0; }","typeGuard":null,"tryCatchPattern":"try { FormatDecode.decode(fmt, argc); } catch (IllegalFormatException e) { /* fix the character after %t */ }","preventionTips":["Verify %t suffixes against the java.util.Formatter date/time table","Prefer DateTimeFormatter for new code"],"tags":["intellij","format-string","inspection","java","date-time"],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}