/** * Returns the end time of auction. * * @param product * @return */ public static String getAuctionEndingTime(Product product) { // Finding the auction of inputed product. Auction auction = getAuctionByProduct(product); // Checking if there is auction for inputed product. if (auction != null) { // Finding and returning auction end time. Date endingDate = auction.endingDate; return CommonHelpers.getTimeFromDate(endingDate); } return CommonHelpers.getTimeFromDate(new Date()); }