It calculates the time just like Facebook whenever a new post or anything is uploaded and this function is used to calculate the time distance from the current time.