Problem:
Year for the date 31st Dec 2023 is showing as 2024 i.e Instead of showing 12/31/2023 it shows 12/31/2024.
Resolution:
This date issue is caused due to the usage of Day pattern format "<entry key="day" value="MM/dd/YYYY"/>" in your applicationContext-catFactory.xml which is showing 12/31/2024 instead of 12/31/2023.
This is a JVM behavior. “yyyy” represents the calendar year whereas “YYYY” represents the year of the week, used in the ISO year-week calendar
in case year end date is in mid week and that week ends in new year resulting in the year value change. Its always better to use "yyyy".
So, Please change your Day pattern format from "<entry key="day" value="MM/dd/YYYY"/>" to "<entry key="day" value="MM/dd/yyyy"/>" , Clear temp and work folder of your tomcat and restart the server.
Now this should show the correct year for the last date.
Recommended Comments
There are no comments to display.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now