Date
API JAVA-W1072That’s all we can say right now.
java.util.Date
API should be avoided.
Use of the old Date
API has been the source of many bugs in various Java programs. The design of this API is heavily
criticised by the Java community. Some notable oddities include:
1. Mutability of Date
instances.
2. Months being zero indexed.
3. No support for timezones.
Therefore, it is highly recommended to use an alternative API to work with date and time.
Replace all usage of Date
with Clock if you are on
Java version greater than 8. For earlier Java versions, consider using Joda-Time.
If you would like to keep using the Date
API, consider adding an ignore rule for this project. See here
for more information on that.