Get the latest tech news
Java's SimpleDateFormat: YYYY vs. Yyyy
This post would have been more appropriate a week ago when 2018 was coming to a close but better late than never. This is a friendly reminder that when formatting dates in Java’s SimpleDateFormat class there is a subtle difference between YYYY and yyyy.
This post would have been more appropriate a week ago when 2018 was coming to a close but better late than never. The first and last make sense since the two year formats match. In general, you should almost always use yyyy so it’s a good tactic to add some form of linting or checking to make sure your code does not have any date formats referencing YYYY.
Or read this on Hacker News