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.
The Java Calendar works fine, just keep in mind that there are Constants for the Months (ie. Calendar.JANUARY) - and these start with zero.
The last test cases are using day at the end of the months, which can give you not real dates if you are setting the month of a Calendar instance to 8 and expecting it to be august (8 = Calendar.SEPTEMBER)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Library Fine
You are viewing a single comment's thread. Return to all comments →
The Java Calendar works fine, just keep in mind that there are Constants for the Months (ie. Calendar.JANUARY) - and these start with zero. The last test cases are using day at the end of the months, which can give you not real dates if you are setting the month of a Calendar instance to 8 and expecting it to be august (8 = Calendar.SEPTEMBER)