We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
This code works. But I don't understand it is showing correct answer if I do 'month-1', directly passing month producing a wrong result. Can anyone explain me why I need to pass 'month-1' in the month field to get correct output?
Java Date and Time
You are viewing a single comment's thread. Return to all comments →
This code works. But I don't understand it is showing correct answer if I do 'month-1', directly passing month producing a wrong result. Can anyone explain me why I need to pass 'month-1' in the month field to get correct output?