Files
openide/java/java-impl/resources/inspectionDescriptions/SuspiciousDateFormat.html
Leonid Shalupov 40795fe787 IJI-2422: community/java: move resources under resources root
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
2025-02-05 04:43:28 +00:00

23 lines
1.2 KiB
HTML

<html>
<body>
Reports date format patterns that are likely used by mistake.
<p>The following patterns are reported:</p>
<ul>
<li>Uppercase "Y", unless "w" appears nearby. It stands for "Week year" that is almost always
the same as normal "Year" (lowercase "y" pattern), but may point to the next year
at the end of December.</li>
<li>Uppercase "M" (month) close to "H", "K", "h", or "k" (hour). It's likely that a lowercase "m" (minute) was intended.</li>
<li>Lowercase "m" (minute) close to "y" (year) or "d" (day in month). It's likely that an uppercase "M" (month) was intended.</li>
<li>Uppercase "D" (day in year) close to "M", or "L" (month). It's likely that a lowercase "d" (day in month) was intended.</li>
<li>Uppercase "S" (milliseconds) close to "m" (minutes). It's likely that a lowercase "s" (seconds) was intended.</li>
</ul>
<p>
Examples:<br>
<code>new SimpleDateFormat("YYYY-MM-dd")</code>: likely <code>"yyyy-MM-dd"</code> was intended.<br>
<code>new SimpleDateFormat("yyyy-MM-DD")</code>: likely <code>"yyyy-MM-dd"</code> was intended.<br>
<code>new SimpleDateFormat("HH:MM")</code>: likely <code>"HH:mm"</code> was intended.
</p>
<!-- tooltip end -->
<p><small>New in 2020.1</small></p>
</body>
</html>