Retrieve farthest date out of multiple date attribute from different source

compare the date with current date and take offset. Whichever offset is highest is your output. You can google the java code for this.