My question is related to the answer which was deleted by one of the moderators.
The OP's question was how to check if a Date is greater than other in java.
As I found one external answer which can clearly solve the OP's answer and as we are not allowed to post links as answers.
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes.
So I have copied the code from the source link and posted it as an answer. I have also given the source link in my answer.
My question:
- What modifications should I do to make it visible to future users as it's deleted?
- If in future, if I want to post code from external sites then how should I do that (https://stackoverflow.com/help/referencing does not mention about showing code from external sites)?
When you find a useful resource that can help answer a question (from another site or in an answer on Stack Overflow) make sure you do all of the following:
- Provide a link to the original page or answer
- Quote only the relevant portion
- Provide the name of the original author
For the above answer I am not showing the author name, but I am showing the relevant codes and the source link.